Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 user-entered 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. Assume1 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): Enter the height of the wall in feet: 12 Enter the width of the wall in feet: 15 Total area to paint in square feet: 180 Total number of gallons of paint needed: 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
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