Advertisement
fumanbest

SkiTrip

Dec 4th, 2018
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.83 KB | None | 0 0
  1. allDayStay = int(input())
  2. room = input()
  3. grade = input()
  4. roomSum = 0
  5. discount = 0
  6. while True:
  7.     if room == 'room for one person':
  8.         roomSum = 18.00
  9.         personSum = (allDayStay - 1) * roomSum
  10.         if grade == 'positive':
  11.             discount = personSum + (personSum * 0.25)
  12.             print(f"{discount:.2f}")
  13.             break
  14.         else:
  15.             if grade == 'negative':
  16.                 discount = personSum - (personSum * 0.10)
  17.                 print(f"{discount:.2f}")
  18.                 break
  19.     if room == 'apartment':
  20.         roomSum = 25.00
  21.         apartSum = (allDayStay - 1) * roomSum
  22.         if allDayStay <= 10:
  23.             discount = apartSum - (apartSum * 0.30)
  24.         elif allDayStay <= 15:
  25.             discount = apartSum - (apartSum * 0.35)
  26.         elif allDayStay > 15:
  27.             discount = apartSum - (apartSum * 0.50)
  28.         if grade == 'positive':
  29.             discount += discount * 0.25
  30.             print(f"{discount:.2f}")
  31.             break
  32.         else:
  33.             if grade == 'negative':
  34.                 discount -= discount * 0.10
  35.                 print(f"{discount:.2f}")
  36.                 break
  37.     if room == 'president apartment':
  38.         roomSum = 35.00
  39.         presidSum = (allDayStay - 1) * roomSum
  40.         if allDayStay <= 10:
  41.             discount = presidSum - (presidSum * 0.10)
  42.         elif allDayStay <= 15:
  43.             discount = presidSum - (presidSum * 0.15)
  44.         elif allDayStay > 15:
  45.             discount = presidSum - (presidSum * 0.20)
  46.         if grade == 'positive':
  47.             discount += discount * 0.25
  48.             print(f"{discount:.2f}")
  49.             break
  50.         else:
  51.             if grade == 'negative':
  52.                 discount -= discount * 0.10
  53.                 print(f"{discount:.2f}")
  54.                 break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement