Problem 3: PLEASE USE PYTHON to solve all parts to this problem

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 29PE
icon
Related questions
Question

Problem 3:

PLEASE USE PYTHON to solve all parts to this problem

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.

 

Template:

from math import ceil                     # needed in Step #3

              # type your code adding plenty of comments for a better understanding of the steps

 

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. Calculate and output the amount of paint needed to three decimal places. One gallon of paint covers 350 square feet.

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

 

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 module 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. Calculate and output the paint cost, sales tax of 7%, and total cost. Dollar values are output with two decimal places.

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(s)

Paint cost: $49.20

Sales tax: $3.44

Total cost: $52.64

Expert Solution
Step 1: Summary

I have provided  PYTHON CODE  along with CODE SCREENSHOT and  OUTPUT  SCREENSHOT-------------

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Binary numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr