Sichanov

bike race

May 28th, 2021
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. number_junior_bikers = int(input())
  2. number_senior_bikers = int(input())
  3. type_of_race = input()
  4. junior_price = 0
  5. senior_price = 0
  6.  
  7. if type_of_race == 'trail':
  8.     junior_price = 5.50
  9.     senior_price = 7
  10. elif type_of_race == 'cross-country':
  11.     junior_price = 8
  12.     senior_price = 9.50
  13.     if number_junior_bikers + number_senior_bikers >= 50:
  14.         junior_price *= 0.75
  15.         senior_price *= 0.75
  16. elif type_of_race == 'downhill':
  17.     junior_price = 12.25
  18.     senior_price = 13.75
  19. elif type_of_race == 'road':
  20.     junior_price = 20
  21.     senior_price = 21.50
  22.  
  23. total_price = number_junior_bikers * junior_price + number_senior_bikers * senior_price
  24. after_tax = total_price - total_price * 0.05
  25.  
  26. print(f'{after_tax:.2f}')
Advertisement
Add Comment
Please, Sign In to add comment