Advertisement
LettuceBeep

Pay Rate calculator

Apr 9th, 2020
629
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.74 KB | None | 0 0
  1. import time
  2. def main():
  3.     rate = 15.75
  4.     nightDiff = 1.89
  5.     weekendDiff = 3.00
  6.     taxes = 1.204
  7.  
  8.     hours = float(input("Enter your total hours worked: \n"))
  9.     weekend = float(input("Enter your hours worked on the weekend: \n"))
  10.  
  11.     grossPay = (rate*hours) + (nightDiff*hours) + (weekendDiff*weekend)
  12.  
  13.     print ("Your gross pay is: " + str(grossPay))
  14.     answer = int(input("Would you like your net pay? 1: Yes / 2: No \n"))
  15.     if answer == 1:
  16.         netPay = grossPay/1.204
  17.         print("Your net pay is: " + str(netPay))
  18.     elif answer == 2:
  19.         print("Goodbye!")
  20.         main()
  21.     else:
  22.         print ("That is not a valid respose. Please try again.")
  23.         main()
  24. if __name__ == '__main__':
  25.         main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement