Question: 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
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 will take the length of a side of a residents backyard (in feet) as in input and then output the amount of dollars that such a fence will cost
. --Note-- You will not be required to write any cout statements asking the user for input. You will simply write the code and place your input(s) into the "Enter program input (optional)" text box recalling that multiple inputs are separated by a space
#include
int main() { cout << " Enter side of fence: " << endl; float side; float perimeter; float cost; cin>>side; perimeter = side * 4; cost = perimeter * 10; cout << " For side of " << side << "feet, length of fence is " << perimeter << "feet" ; cout<< " Cost of fencing = " << cost <<" dollars"; return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
