Question: area. Total cost includes paint and sales tax. Note: This program is designed for incremental development. Complete each step and submit for grading before
area. Total cost includes paint and sales tax. Note: This program is designed for incremental development. Complete each step and submit for grading before starting the next step. Only a portion of tests pass after each step but confirm progress. Write a program to calculate the cost to paint a wall. Amount of required paint is based on the wall Step 1 (2 pts). Read from input wall height, wall width, and cost of one paint can (doubles). Calculate and output the wall's area to one decimal place using System.out.printf ("Wall area: %.1f sq ft ", area); Submit for grading to confirm 1 test passes. Ex: If the input is: 12.0 15.0 29.95 the output is: Wall area: 180.0 sq ft Step 2 (2 pts). Calculate and output the amount of paint needed to three decimal places. One gallon of paint covers 350 squar feet. Submit for grading to confirm 2 tests pass. Ex: If the input is: 12.0 15.0 29.95 the output is: Wall area: 180.0 sq ft Paint needed: 0.514 gallons Paint needed: 0.514 gallons Step 3 (2 pts). Calculate and output the number of 1 gallon cans needed to paint the wall. Extra paint may be left over. Hint: Use celo to round up to the nearest gallon and convert to an integer. Submit for grading to confirm 4 tests pass. Ex If the input is 12.0 15.0 29.95 the output is Wall areal 180.0 sq ft Paint needed: 0.5142 gallons : Cans needed: 1 can (a) Step 4 (4 pts). Calculate and output the paint cost, sales tax of 7%, and total cost. Dollar values are output with two decimal places Submit for grading to confirm all tests pass Ex: If the input is: 8.0 8.0 49.20 the output is: Wall area: 64.0 sq ft. Paint needed: 0.183 gallons Cans needed: 1 can (a) Paint cost: $49.20 Sales tax: $3.44 Total cost: 552.64 Adat LAB ACTIVITY 2.31.1: LAB Program: Painting a wall 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() { 7 8 9 10 1 11 Type your code here. / return 0; Develop mode Submit mode main.cpp // needed for setprecision() and fixed // needed for ceil() Enter program input (optional) If your code requires input values, provide them here. 0/10 Load default template... Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box
Step by Step Solution
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Step 1 include include include using namespace std int main declare variables double wallHeight wallWidth costOfOneCan wallArea rad wall height width and cost of one can of paint cin wallHeight wallWi... View full answer
Get step-by-step solutions from verified subject matter experts
