Question: 2 . 2 4 Lab Exercise Ch 2 b: Painting a wall, with string ( 1 ) Your code is to be written and tested
Lab Exercise Ch b: Painting a wall, with string
Your code is to be written and tested in Visual C and Source.cpp should be uploaded to ZyLab to verify with its tests. If your cpp file is NOT named source, do a "save as source.cpp before uploading.
Prompt the user to input a paint color, and save that in a string variable. Also prompt the user for the wall's height and width. Calculate and output the wall's area. pt
Note: This zyLab outputs a newline after each userinput prompt. For convenience in the examples below, the user's input value is shown on the next line, but such values don't actually appear as output when the program runs.
Enter paint color:
green
Enter wall height feet:
Enter wall width feet:
Wall area: square feet
Extend to also calculate and output the color and the amount of paint in gallons needed to cover the wall. Assume a gallon of paint covers square feet. Store this assumed coverage in a const double variable. pt
Enter paint color:
green
Enter wall height feet:
Enter wall width feet:
Wall area: square feet
Needed: gallons of green paint
Extend to also calculate and output the number of gallon cans needed to paint the wall. Hint: Use a math function from the cmath library to round up to the nearest gallon. pt
Enter paint color:
red
Enter wall height feet:
Enter wall width feet:
Wall area: square feet
Needed: gallons of red paint
Cans needed: cans
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
