Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python: Intro to Programming A painting company has determined that for every 12

ID: 3671401 • Letter: P

Question

Python: Intro to Programming

A painting company has determined that for every 125 square feet of wall space, one gallon of paint and eight hours of labor are required. The company charges $42.50 per hour for labor. Write a program call paintjob.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).

Explanation / Answer

Answer

# cook your code here

class paintGallon():

    def calculateGallon(self,*args):

        print "would like to perform estimartion";

        estimation = raw_input("Enter yes or no (y/n)";

        if estimation =='Y':

            print "number of gallons of paint required rounded up to whole gallons."

            gallon = raw_input('Enter gallons');

            print "The hours of labor required.

            labor = raw_input("enter hours of labor required');

            costofGallon = gallon *labor;

            print "The cost of the paint based on the rounded up whole gallons"

            print costofGallon

            print "The labor charges."

            print "The total cost of the paint job."

        else:

            print "You entered theres is no estimation is required"

            exit(0);

     if __name__=='__main__':

                paintGall.calculateGallon();