Step 3 Calculate and output the number of 1 gallon cans needed to paint the wall. Extra paint may be left over. Hint: Use ceil() from the math mouule to round up to the nearest gallon (int). Ex: If the input is: 12.0 15.0 29.95 the output is: Wall area: 180.0 sq ft Paint needed: 0.5142 gallons. Cans needed: 1 can (s) Step 4 Ex: If the input is: 8.0 8.0 49.20 Calculate and output the paint cost, sales tax of 7%, and total cost. Dollar values are output with two decimal places. the output is: Wall area: 64.0 sq ft Paint needed: 0.183 gallons Cans needed: 1 can (s) Paint cost: $49.20 Sales tax: $3.44 Total cost: $52.64
Hi need help with this problem. The
![3.17 LAB*: Program: Painting a wall
Program Specifications Write a program to calculate the cost to paint a wall. Amount of required paint is based on the wall area. Total cost
includes paint and sales tax.
Note: This program is designed for incremental development.
Step 1
Read from input wall height, wall width, and cost of one paint can (floats). Calculate and output the wall's area to one
decimal place using print (f"wall area: {wall_area:.1f} sq ft");
Ex: If the input is:
12.0
15.0
29.95
the output is:
Wall area: 180.0 sq ft
Step 2
Ex: If the input is:
12.0
15.0
29.95
Calculate and output the amount of paint needed to three decimal places. One gallon of paint covers 350 square feet.
the output is:
Wall area: 180.0 sq ft
Paint needed: 0.514 gallons](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F38ffcadc-da65-4b22-b38b-e3b0eee6db32%2Fc21c9e12-c14c-4670-904a-8ece7b3ce86f%2Fhk89xdp_processed.png&w=3840&q=75)
![Step 3
Calculate and output the number of 1 gallon cans needed to paint the wall. Extra paint may be left over. Hint: Use ceil() from
the math mouule to round up to the nearest gallon (int).
Ex: If the input is:
12.0
15.0
29.95
the output is:
Wall area: 180.0 sq ft
Paint needed: 0.5142 gallons
Cans needed: 1 can (s)
Step 4
Ex: If the input is:
8.0
8.0
49.20
Calculate and output the paint cost, sales tax of 7%, and total cost. Dollar values are output with two decimal places.
the output is:
Wall area: 64.0 sq ft
Paint needed: 0.183 gallons
Cans needed: 1 can (s)
Paint cost: $49.20
Sales tax: $3.44
Total cost: $52.64
454192.2153518.qx3zqy7](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F38ffcadc-da65-4b22-b38b-e3b0eee6db32%2Fc21c9e12-c14c-4670-904a-8ece7b3ce86f%2F56dydxk_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
The Algorithm of the code:-
1. Read the wall height, width, and cost of a paint can and store the values in variables.
2. Calculate the wall area by multiplying the height and width, and storing the value in a variable.
3. Calculate the amount of paint needed by dividing the wall area by 350 and store the value in a variable.
4. Calculate the number of cans needed by rounding up the amount of paint needed and store the value in a variable.
5. Calculate the paint cost by multiplying the cost of a paint can by the number of cans needed, and store the value in a variable.
6. Calculate the sales tax by multiplying the paint cost by 0.07, and store the value in a variable.
7. Calculate the total cost by adding the paint cost and sales tax, and store the value in a variable.
8. Output the wall area, paint needed, cans needed, paint cost, sales tax, and total cost.
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)