Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. #print_output
  2. import math
  3. menu = 'Menu:\nr: Regular\ns: Supervisor\nm: Manager'
  4. print(menu)
  5. worker = (str(input(" ")))
  6. print("Enter work day: ")
  7. day = str(input(" "))
  8. print("Enter work hours: ")
  9. hrs = int(input(" "))
  10.  
  11. #set worker to right percentage
  12. w1 = worker == "r"
  13. w2 = worker == "s"
  14. w3 = worker == "m"
  15. worker = 1*w1 + 1.2*w2 + 1.5*w3
  16.  
  17. #match day to correct list
  18. is_weekday = ([day =="sun", day =="sun"]) or ([day =="mon", day =="mon"]) or ([day =="tue", day =="tue"]) or ([day =="wed", day =="wed"]) or ([day =="thu", day =="thu"])
  19. is_weekend = not is_weekday
  20.  
  21.  
  22. weekday = is_weekday and [30,35]
  23. weekend = is_weekend and [42,49]
  24.  
  25.  
  26. hrs_plus = hrs - 8
  27.  
  28.  
  29. day = (hrs<=8 and hrs*weekday[0]) or (hrs<=8 and hrs*weekend[0]) or (hrs>8 and 8*weekday[0]+hrs_plus*weekday[1]) or (hrs>8 and 8*weekend[0] + hrs_plus*weekend[1])
  30. print(day)
  31. salary = worker*day
  32.  
  33. print("the daily salary is: " , salary)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement