Question

I need to write a paint job estimator program in python. I have most of it...

I need to write a paint job estimator program in python. I have most of it down but i keep getting errors and I dont know how to fix it or what im doing worng

specs:

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).

The gallons of paint is rounded up to whole gallons because the paint is colored and mixed in whole gallons. If paint is left over it can’t be used on another job. You will need to find a way in Python to do the math to calculate the gallons of paint so that the result is a whole number that is a rounded up value based on the division of the square feet of space by the 350 square feet per gallon. For example, if the area to be painted is 1800 square feet, then 1800 / 350 is 5.142857 gallons. The rounded up whole gallons result is 6. Five gallons of paint is not enough. The need for some amount more than 5 gallons means the job requires 6 gallons even if all of it will not be used.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution:

code:

import math


def main():
    while True:

        # Taking the input from the user for the square feet of the wall to paint and ask use until the user enters positive integer value

        while True:

            square_feet = input('Enter square feet of wall to paint: ')

            square_feet = int(square_feet)

            if square_feet < 0:

                print('square feet has to be positive integer')

                continue

            elif square_feet == 0:

                print('square feet must be positive not zero')

                continue

            # if square feet is greater than 0 the loop terminates

            else:

                break

                # Taking the input from the user for the pricePaint of the painting bucket and ask the user until the user enters positive integer value

        while True:

            pricePaint = input('Enter pricePaint of paint per gallon: ')

            pricePaint = int(pricePaint)

            if pricePaint < 0:

                print('price has to be positive integer')

                continue

            elif pricePaint == 0:

                print('price has to be positive integer not zero')

                continue

            # if pricePaint > 0 the loop terminates

            else:

                break

                # getting theGallons based on the price of the paint

        theGallons = square_feet / 350

        # calculating the number of numOfHours required to paint

        numOfHours = theGallons * 6



        theGallons = math.ceil(theGallons)

        # getting cost of the paint from theGallons

        paintCost = pricePaint * theGallons

        # getting theLabourCharge based on number of numOfHours

        theLabourCharge = 62.25 * numOfHours

        # calculating total paint cost

        totalCost = paintCost + theLabourCharge

        print("theGallons: %5d, numOfHours of labor: %.1f, Paint Cost: %.2f, Labour Charge: $%.2f, Total Paint Cost: $%.2f" % (
        theGallons, numOfHours, paintCost, theLabourCharge, totalCost))

        # getting choice from user

        choice = input('Would you like to do another estimate(y/n)? ')

        # if the choice is yes the program will do another estimate

        if choice.upper() == 'Y':

            pass

        # if the choice is no or anything then program will terminate

        elif choice.upper() == 'N' or choice.upper() != 'N':

            break


if __name__ == "__main__":
    main()

Output:


Hit the thumbs up if you liked the answer. :)

Add a comment
Know the answer?
Add Answer to:
I need to write a paint job estimator program in python. I have most of it...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Paint Job Estimator in Python and Raptor Psusedo

    Hello, I have seen this in Java and C++ but I am trying to learn it in Python ..any help on the code would be great..ThanksPaint job estimatorQuestion DetailsA painting company has determined that for every 115 square feet or wall space, one gallon of paint and eight hours of labor will be required. The company charges$20.00 per hour for labor . Write a program that allows the user to enter the number of rooms to be painted and the...

  • This exercise requires designing a program which solves the problem described in the problem statement below....

    This exercise requires designing a program which solves the problem described in the problem statement below. Provide comments as necessary in your pseudo-code and the Java program. Your solution must include these components: Flowchart Pseudo-code Hierarchy Chart Program Coded Program Output Problem Statement A painting company has determined that to paint 115 square feet of wall space, the task will require one gallon of paint and 8 hours of labor. The company charges $20.00 per hour for labor. Design a...

  • PLEASE HELP WITH CODE PYTHON BASE.!!!!!!!! Tasks: Complete the following programs noted below: Problem 1: A...

    PLEASE HELP WITH CODE PYTHON BASE.!!!!!!!! Tasks: Complete the following programs noted below: Problem 1: A painting company has determined that for 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program that asks the user to enter the square feet of wall space to be painted and the price of paint per gallon. The program should display the following data:...

  • A painting company has determined that for every 110 square feet of wall space, one gallon...

    A painting company has determined that for every 110 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $25.00 per hour for labor. Write a modular program that allows the user to enter the number of rooms that are to be painted (different colors) and the price of the paint per gallon. It should also ask for the square feet of wall space in each room. Rooms and gallons...

  • C++, please make it as simple as possible. A Paint Company is hiring you to develop...

    C++, please make it as simple as possible. A Paint Company is hiring you to develop an application to estimate the costs for a job. They have determined that for every 120 square feet of wall area, one gallon of paint and eight hours of labor is required. The company charges US$ 18.00 per hour for labor. Write a modular program that allows the user to enter the number of rooms that are to be painted and the price of...

  • Tasks: Complete the following programs noted below: Problem 1: A painting company has determined that for...

    Tasks: Complete the following programs noted below: Problem 1: A painting company has determined that for 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program that asks the user to enter the square feet of wall space to be painted and the price of paint per gallon. The program should display the following data: The use of functions is required....

  • A painting company has determined that for every 112 square feet of wall space, one gallon...

    A painting company has determined that for every 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor. Write a program that asks the user to enter the square feet of wall space to be painted and the price of the paint per gallon. Use a function (or multiple functions if you want) to calculate the following values - you also need to output...

  • I need help making a javascript program to do the following: A painting company has determined...

    I need help making a javascript program to do the following: A painting company has determined that for every 112 square feet of wall space, one gallon of paint and eight hours of labor will be required. The company charges $35.00 per hour for labor and $15.00 for a gallon of paint. Write a function that takes in the number of square feet of wall space and displays the following data: The number of gallons of paint required The hours...

  • code in C++ Create a program that uses the pass by reference operator instead of the...

    code in C++ Create a program that uses the pass by reference operator instead of the return command. Your main program will need to: create empty variables call void function 1 with no input to display your name to the screen call function 2 to collect the square feet that a gallon of paint covers from user call function 2 to collect the square feet of wall that needs to be painted call function 3 to calculate the number of...

  • in python please (1) Prompt the user to input a wall's height and width. Calculate and...

    in python please (1) Prompt the user to input a wall's height and width. Calculate and output the wall's area (integer). (Submit for 2 points). Enter wall height (feet): 12 Enter wall width (feet): 15 Wall area: 180 square feet (2) Extend to also calculate and output the amount of paint in gallons needed to paint the wall (floating point). Assume a gallon of paint covers 350 square feet. Store this value in a variable. Output the amount of paint...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT