Sichanov

ski trip

May 28th, 2021
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.30 KB | None | 0 0
  1. days = int(input())
  2. room = input()
  3. scale = input()
  4.  
  5. bonus = 0
  6. if room == "room for one person":
  7.     total_nights = (days - 1) * 18
  8.     bonus = 0
  9.     if scale == "positive":
  10.         bonus_2 = (0.25 * total_nights) + total_nights
  11.     elif scale == "negative":
  12.         bonus_2 = total_nights - (0.10 * total_nights)
  13.     print(f"{bonus_2:.2f}")
  14. elif room == "apartment":
  15.     total_nights = (days - 1) * 25
  16.     if days < 10:
  17.         bonus = 0.30
  18.     elif 10 <= days <= 15:
  19.         bonus = 0.35
  20.     elif days > 15:
  21.         bonus = 0.5
  22.     bonus_4 = total_nights - (bonus * total_nights)
  23.     if scale == "positive":
  24.         extra = bonus_4 * 0.25
  25.         whole_price = bonus_4 + extra
  26.     elif scale == "negative":
  27.         extra = bonus_4 * 0.10
  28.         whole_price = bonus_4 - extra
  29.     print(f"{whole_price:.2f}")
  30.  
  31. if room == "president apartment":
  32.     total_nights = (days - 1) * 35
  33.     if days < 10:
  34.         bonus = 0.1
  35.     elif 10 <= days <= 15:
  36.         bonus = 0.15
  37.     elif days > 15:
  38.         bonus = 0.2
  39.     bonus_5 = total_nights - (bonus * total_nights)
  40.     if scale == "positive":
  41.         extra = bonus_5 * 0.25
  42.         whole_price = bonus_5 + extra
  43.     elif scale == "negative":
  44.         extra = bonus_5 * 0.10
  45.         whole_price = bonus_5 - extra
  46.     print(f"{whole_price:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment