Variables – Painting a wall
Variables – Painting a wall In this assignment, you’ll 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. 1. 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. 2. 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 3. 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. 4. 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. 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
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
