Advertisement
Guest User

saDSD

a guest
Feb 26th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.09 KB | None | 0 0
  1. #David vasilescu
  2. #2/26/17
  3. #Jennifer Marquez
  4. #Program that calculates the amount of paint needed for jobs.
  5.     #vars
  6.  
  7. paintg=0
  8. paintpay=0
  9. hours=0
  10. pay=0
  11. total=0
  12. #main method.
  13. def main(welcome,getSquareFeet,getPricePerGallon,calcs,display):
  14.     getSF=getSquareFeet(getSquareFeet)
  15.     gallon=getPricePerGallon(getPricePerGallon)
  16.     #callbacks for main.
  17.     welcome()
  18.     getSquareFeet(getSF)
  19.     getPricePerGallon(gallon)
  20.     calcs(getSF,gallon,paintg,paintpay,hours,pay,total)
  21.     display(pay,getSF,paintg,hours,total)
  22.    
  23. #opening text.
  24. def welcome():
  25.     print("==========================================")
  26.     print("Welcome to the Paint job Estimator Program")
  27.     print("==========================================")
  28.     print()
  29.    
  30. #asks user for square feet of wall.  
  31. def getSquareFeet(getSF):
  32.     getSF=float(int(input("Enter the square feet of the wall: ")))
  33.     print("You entered ",getSF,"Square feet.")
  34.     return getSF
  35.  
  36. #asks user for price of gallon.
  37. def getPricePerGallon(gallon):
  38.     gallon=float(int(input("Enter the price per gallon of paint: ")))
  39.     print("Each gallon of paint will cost $",gallon)
  40.     return gallon
  41.  
  42. #does the math for the program.d    
  43. def calcs(getSF,gallon,paintg,paintpay,hours,pay,total):
  44. #1 gal = 115 SF & 8 hour of work -- $20 = 1 hour of work
  45.     paintg=(getSF/115)
  46.     paintpay=gallon*paintg
  47.     hours=paintg*8
  48.     pay=hours*20
  49.     total=pay+paintpay
  50.    
  51. #end display text.
  52. def display(pay,getSF,paintg,hours,total):
  53.     print()
  54.     print("-------------------------------------------------------------------------------")
  55.     print("[+]The amount of paint required to paint the",getSF,"Square foot wall will take",paintg)
  56.     print("gallons of paint to finish.")
  57.     print()
  58.     print("[+]To finish the project it will take",hours,"hours.")
  59.     print()
  60.     print("[+]We charge $20 per hour of labor. The total cost of the paint job will be", total)
  61.     print("-------------------------------------------------------------------------------")
  62.     print()
  63.    
  64.    
  65.  
  66. main(welcome,getSquareFeet,getPricePerGallon,calcs,display)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement