Question

7.4 Practice Problem Set 1 Q3 You live in squareville. Everyone in squareville wants a fence around their backyard, but they

How do I do this?

Using c++

0 0
Add a comment Improve this question Transcribed image text
Answer #1

C++ CODE:

#include<iostream>

using namespace std;

int main()
{
   //variable to store the length and cost
   double length;
   double cost;
  
   //getting the length of the backyard
   cout<<"Enter the length of the backyard: ";
   cin>>length;
  
   //calculating the fence cost
   //since, the fence must be 2 feet inside the perimeter of
   //backyard, square backyard becomes rectangular shape
   //perimeter of the rectangle is 2(l+b)
   cost=2*(length+length-2) * 10;
  
   //displaying the cost
   cout<<"Fence cost: $"<<cost;
}

SCREENSHOT FOR OUTPUT:

Enter the length of the backyard : 15 Fence cost: $560 Process exited after 4.986 seconds with return value o Press any key t

Add a comment
Know the answer?
Add Answer to:
How do I do this? Using c++ 7.4 Practice Problem Set 1 Q3 You live in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Help C++ Design a program for determining how much a fence will cost based on the...

    Help C++ Design a program for determining how much a fence will cost based on the size of a residents back yard. Luckily, every resident has a square backyard with side lengths of at least 6 feet. Unfortunately, there is a local zoning requirement that all fences must be exactly 2 feet inside the perimeter of a backyard. The local fence construction company will charge 10 dollars per foot of fence. Based on the description above design a program that...

  • 1. In this exercise, you will analyze the supply-demand equilibrium of a city under some special...

    1. In this exercise, you will analyze the supply-demand equilibrium of a city under some special simplifying assumptions about land use. The assumptions are: • all dwellings are situated within apartment complexes, • all dwellings must contain exactly 1,500 square feet of floor space, re- gardless of location, and • apartment complexes must contain exactly 15,000 square feet of floor space per square block of land area. These land-use restrictions, which are imposed by a zoning authority, mean that dwelling...

  • C PROGRAMMING Introduction In this part, you will solve a problem described in English. Although you...

    C PROGRAMMING Introduction In this part, you will solve a problem described in English. Although you may discuss ideas with your classmates, etc., everyone must write and submit their own version of the program. Do NOT use anyone else’s code, as this will result in a zero for you and the other person! Shipping Calculator Speedy Shipping Company will ship your package based on the weight and how far you are sending the package, which can be anywhere in the...

  • In this exercise, you will analyze the supply-demand equilibrium of a city under some special simplifying...

    In this exercise, you will analyze the supply-demand equilibrium of a city under some special simplifying assumptions about land-use. The assumptions are: (i) all dwellings must contain exactly 1500 square feet of floor space, regardless of location, and (ii) apartment complexes must contain exactly 15,000 square feet of floor space per square block of land area. These land-use restrictions, which are imposed by a zoning authority, mean that dwelling sizes and building heights do not vary with distance to the...

  • 1) bomar imorgan x > Project Management in Practice x + 532 Project Management in_Practice_6th_6bf4.pdf C...

    1) bomar imorgan x > Project Management in Practice x + 532 Project Management in_Practice_6th_6bf4.pdf C A SE Friendly Assisted Living Facility Project Budget Development-4 Fred Splient gave his ALF Project Steering Committee 2 months to develop a project plan for their area of respon sibility in the project. Each member was told to include the tasks predecessors and successors, resources needed, responsible person, and an estimated cost. He asked that these be presented to the steering team on August...

  • plz answer the questions at the bottom 1) bomar imorgan x > Project Management in Practice...

    plz answer the questions at the bottom 1) bomar imorgan x > Project Management in Practice x + 532 Project Management in_Practice_6th_6bf4.pdf C A SE Friendly Assisted Living Facility Project Budget Development-4 Fred Splient gave his ALF Project Steering Committee 2 months to develop a project plan for their area of respon sibility in the project. Each member was told to include the tasks predecessors and successors, resources needed, responsible person, and an estimated cost. He asked that these be...

  • Hi, i just need the highlighted ones. Thank you! CHAPTER 1 Understanding Personal Finance 33 LET'S...

    Hi, i just need the highlighted ones. Thank you! CHAPTER 1 Understanding Personal Finance 33 LET'S TALK ABOUT IT 1. Economic Growth. What tpes of federal government Federal Reserve. Describe some economic circumstances that might persuade the Federal Reserve to lower short-term inter- ctfoets to help stimulate economic growth affect 2 The Business Cycle. Where is the United States in the economic cycle now, and where does it seem to be heading? List some indicators that suggest in which direction...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT