Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. rate1 = 5
  2. rate2 = 4
  3. rate3 = 3
  4.  
  5. m = int(input(" Please enter number of minutes parked..."))
  6. if ( m <= 60 ):
  7. # the fee will always be the same rate if 60 minutes or less, equation unnessary and when m = 60 the +1 was charging
  8. # for 2 hours, it was more efficient to reduce the work here
  9. fee = rate1
  10. print("Parking fee for ", m, " minutes is $", fee)
  11. elif ( m <= 300 ):
  12. hrs = int(m/60)
  13. if ( m % 60 != 0 ):
  14. hrs += 1
  15. fee2 = hrs*rate2
  16. print("Parking fee for ", m, " minutes is $", fee2)
  17. else:
  18. hrs = int(m/60)
  19. if ( m % 60 != 0 ):
  20. hrs += 1
  21. fee3 = hrs*rate3
  22. print("Parking fee for ", m, " minutes is $", fee3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement