Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #David vasilescu
- #2/26/17
- #Jennifer Marquez
- #Program that calculates the amount of paint needed for jobs.
- #vars
- paintg=0
- paintpay=0
- hours=0
- pay=0
- total=0
- #main method.
- def main(welcome,getSquareFeet,getPricePerGallon,calcs,display):
- getSF=getSquareFeet(getSquareFeet)
- gallon=getPricePerGallon(getPricePerGallon)
- #callbacks for main.
- welcome()
- getSquareFeet(getSF)
- getPricePerGallon(gallon)
- calcs(getSF,gallon,paintg,paintpay,hours,pay,total)
- display(pay,getSF,paintg,hours,total)
- #opening text.
- def welcome():
- print("==========================================")
- print("Welcome to the Paint job Estimator Program")
- print("==========================================")
- print()
- #asks user for square feet of wall.
- def getSquareFeet(getSF):
- getSF=float(int(input("Enter the square feet of the wall: ")))
- print("You entered ",getSF,"Square feet.")
- return getSF
- #asks user for price of gallon.
- def getPricePerGallon(gallon):
- gallon=float(int(input("Enter the price per gallon of paint: ")))
- print("Each gallon of paint will cost $",gallon)
- return gallon
- #does the math for the program.d
- def calcs(getSF,gallon,paintg,paintpay,hours,pay,total):
- #1 gal = 115 SF & 8 hour of work -- $20 = 1 hour of work
- paintg=(getSF/115)
- paintpay=gallon*paintg
- hours=paintg*8
- pay=hours*20
- total=pay+paintpay
- #end display text.
- def display(pay,getSF,paintg,hours,total):
- print()
- print("-------------------------------------------------------------------------------")
- print("[+]The amount of paint required to paint the",getSF,"Square foot wall will take",paintg)
- print("gallons of paint to finish.")
- print()
- print("[+]To finish the project it will take",hours,"hours.")
- print()
- print("[+]We charge $20 per hour of labor. The total cost of the paint job will be", total)
- print("-------------------------------------------------------------------------------")
- print()
- main(welcome,getSquareFeet,getPricePerGallon,calcs,display)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement