Advertisement
Radismela

ski_trip-Conditional_Statements_Advanced-Lab

Apr 26th, 2021
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.03 KB | None | 0 0
  1. days_in_hotel = int(input())
  2. type_of_room = input()
  3. evaluation = input()
  4. positive = 0.25
  5. negative = 0.10
  6.  
  7. nights = days_in_hotel-1
  8.  
  9. room_one_person = 0
  10. apartment = 0
  11. president_apartment = 0
  12.  
  13. if type_of_room == "room for one person":
  14.     room_one_person = nights * 18
  15.     if 15 > nights < 15 and evaluation == "positive":
  16.         print(f"{(room_one_person+(room_one_person * positive)):.2f}")
  17.     elif 15 > nights < 15 and evaluation == "negative":
  18.         print(f"{(room_one_person - (room_one_person * negative)):.2f}")
  19. elif type_of_room == "apartment":
  20.     apartment = nights * 25     # "apartment" – 25.00 лв за нощувка
  21.     if nights < 10 and evaluation == "positive":
  22.         apartment_discount = apartment - (apartment * 0.30)
  23.         apartment_positive = apartment_discount + (apartment_discount * positive)
  24.         print(f"{apartment_positive:.2f}")
  25.     elif nights < 10 and evaluation == "negative":
  26.         apartment_discount = apartment - (apartment * 0.30)
  27.         apartment_negative = apartment_discount - (apartment_discount * negative)
  28.         print(f"{apartment_negative:.2f}")
  29.     elif 10 <= nights <= 15 and evaluation == "positive":
  30.         apartment_discount = apartment - (apartment * 0.35)
  31.         apartment_negative = apartment_discount + (apartment_discount * positive)
  32.         print(f"{apartment_negative:.2f}")
  33.     elif 10 <= nights <= 15 and evaluation == "negative":
  34.         apartment_discount = apartment - (apartment * 0.35)
  35.         apartment_negative = apartment_discount - (apartment_discount * negative)
  36.         print(f"{apartment_negative:.2f}")
  37.     elif nights > 15 and evaluation == "positive":
  38.         apartment_discount = apartment - (apartment * 0.50)
  39.         apartment_negative = apartment_discount + (apartment_discount * positive)
  40.         print(f"{apartment_negative:.2f}")
  41.     elif nights > 15 and evaluation == "negative":
  42.         apartment_discount = apartment - (apartment * 0.50)
  43.         apartment_negative = apartment_discount - (apartment_discount * negative)
  44.         print(f"{apartment_negative:.2f}")
  45. elif type_of_room == "president apartment":
  46.     president_apartment = nights * 35     # "president_apartment" – 35.00 лв за нощувка
  47.     if nights < 10 and evaluation == "positive":
  48.         president_apartment_discount = president_apartment - (president_apartment * 0.10)
  49.         president_apartment_positive = president_apartment_discount + (president_apartment_discount * positive)
  50.         print(f"{president_apartment_positive:.2f}")
  51.     elif nights < 10 and evaluation == "negative":
  52.         president_apartment_discount = president_apartment - (president_apartment * 0.10)
  53.         president_apartment_negative = president_apartment_discount - (president_apartment_discount * negative)
  54.         print(f"{president_apartment_negative:.2f}")
  55.     elif 10 <= nights <= 15 and evaluation == "positive":
  56.         president_apartment_discount = president_apartment - (president_apartment * 0.15)
  57.         president_apartment_negative = president_apartment_discount + (president_apartment_discount * positive)
  58.         print(f"{president_apartment_negative:.2f}")
  59.     elif 10 <= nights <= 15 and evaluation == "negative":
  60.         president_apartment_discount = president_apartment - (president_apartment * 0.15)
  61.         president_apartment_negative = president_apartment_discount - (president_apartment_discount * negative)
  62.         print(f"{president_apartment_negative:.2f}")
  63.     elif nights > 15 and evaluation == "positive":
  64.         president_apartment_discount = president_apartment - (president_apartment * 0.20)
  65.         president_apartment_negative = president_apartment_discount + (president_apartment_discount * positive)
  66.         print(f"{president_apartment_negative:.2f}")
  67.     elif nights > 15 and evaluation == "negative":
  68.         president_apartment_discount = president_apartment - (president_apartment * 0.20)
  69.         president_apartment_negative = president_apartment_discount - (president_apartment_discount * negative)
  70.         print(f"{president_apartment_negative:.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement