Question
PLEASE DO IN TEXT OR .CPP NO HANDWRITTEN In this assignment, youll create a program that calculates the total gallons of paint needed, cost of
PLEASE DO IN TEXT OR .CPP
NO HANDWRITTEN
In this assignment, youll create a program that calculates the total gallons of paint needed, cost of paint, and amount of time needed to paint a wall. The starter program calculates the area of a wall based on a userentered width and an assumed 10 foot height. Correct the first FIXME by adding code that prompts the user to "Enter the height of the wall in feet: ", then stores the user input to the height variable. Then correct the second FIXME by calculating the amount of paint needed in gallons. Assume 1 gallon of paint covers 350 square feet. Output the amount of paint needed in gallons using the wording specified at the end of the assignment. Development suggestions: Store the amount of paint in a variable. Also, create a const double variable to store the square feet per gallon conversion.
Here is an example program execution (user input is highlighted here for clarity): Entertheheightofthewallinfeet:12
Enterthewidthofthewallinfeet:15
Totalareatopaintinsquarefeet:180
Totalnumberofgallonsofpaintneeded:0.514286
Then assume gallons of paint are sold in units of 1. After calculating the amount of paint needed in gallons, round up the amount of paint needed. For example, if 7.05 gallons are needed, then round up to 8 gallons. The output should now be the rounded up amount. Development suggestion: Use a math function for rounding up. Then correct the third FIXME by calculating then outputting the cost of the paint needed to paint the wall. Assume 1 gallon of paint costs $27. 5. After this, correct the fourth FIXME by calculating then outputting the amount of time needed to paint the wall. Assume 100 square feet per hour. After step 5, here is an example program execution (user input is highlighted here for clarity): Enterthewidthofthewallinfeet:25
Entertheheightofthewallinfeet:25
Totalareatopaintinsquarefeet:625
Totalnumberofgallonsofpaintneeded:2
Totalcostofpaintindollars:54
Totaltimetopaintinhours:6.25
HERE IS THE CODE
#include
int main() { double width = 0.0; double height = 0.0; double area = 0.0; cout << "Enter the width of the wall in feet: "; cin >> width; height = 10; // FIXME Get height as user input // Calculate and output area of wall area = height * width; cout << "Total area to paint in square feet: " << area << endl;
// FIXME Calculate amount of paint needed
// FIXME Calculate cost of paint
// FIXME Calculate time needed to paint
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started