The third picture is what I have so far, I need help finishing the assignments o
ID: 3751885 • Letter: T
Question
The third picture is what I have so far, I need help finishing the assignments other requirements. Thanks in advance! A painting company has determined that for every 350 square feet of wall space, one gallon of paint and six hours of labor are required. The company charges $62.25 per hour for labor. Write a program call paintjobestimator.py that asks the user to enter the square feet of wall space to be painted and the price of the paint per gallon. The program is to display the following information: The number of gallons of paint required rounded up to whole gallons. . The hours of labor required. . The cost of the paint based on the rounded up whole gallons. The labor charges. The total cost of the paint job. At the end of one estimate the user it to be asked if they would like to perform another estimate. Use the prompt: Would you like to do another estimate? (y/n) If the user answers y, then the program is to accept input for another estimate. If the user answers with anything other than y, the program is to exit. The user input should not be able to crash the program. If the user provides invalid input the program should tell the user why the input is invalid and ask again for the input. The square feet of wall space and the price of the paint per gallon must be positive values. If the user enters 0 or a negative value, the program should tell the user why the input is invalid and ask again for the input. The output is to be nicely formatted. Hours of labor is to be displayed to one decimal point (example: 12.4 hours). Gallons of paint is to be displayed as an integer value with nothing shown to the right of the decimal point (example: 5). Total labor charges is to be displayed to two decimal points and a $ is to be displayed at the start of the total labor charge value (example: $152.64) 21Explanation / Answer
import math
print("This program will estimate cost of a pain job")
c = 'y'
while c=='y' or c=='Y':
feet = float(input("Enter the number of square feet of wall space: "))
paint = float(input("Enter the price of paint: "))
if feet<0 or paint<0:
print("Incorrect input. Either feet or price of paint is entered negative.")
else:
gallon = 1.0*feet/350
hr = float("{0:.1f}".format(6.0*feet/350))
cost_paint = float("{0:.2f}".format(hr * 62.25))
cost_labor = float("{0:.2f}".format(hr*25))
print("Number of gallons required "+str(math.ceil(gallon)))
print("The hours of labor reuqired "+str(hr))
print("Labor cost is $"+str(cost_labor))
print("Paint cost is $"+str(cost_paint))
print("Total paint-job cost is $"+str(cost_paint+cost_labor))
c = input("Would you like to go again?(Enter y to go again)")
Watch out for indentation since this textbox always messes up the indentation.
The last line input of c doesn't lie in the else block. It is outside that
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.