Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- allDayStay = int(input())
- room = input()
- grade = input()
- roomSum = 0
- discount = 0
- while True:
- if room == 'room for one person':
- roomSum = 18.00
- personSum = (allDayStay - 1) * roomSum
- if grade == 'positive':
- discount = personSum + (personSum * 0.25)
- print(f"{discount:.2f}")
- break
- else:
- if grade == 'negative':
- discount = personSum - (personSum * 0.10)
- print(f"{discount:.2f}")
- break
- if room == 'apartment':
- roomSum = 25.00
- apartSum = (allDayStay - 1) * roomSum
- if allDayStay <= 10:
- discount = apartSum - (apartSum * 0.30)
- elif allDayStay <= 15:
- discount = apartSum - (apartSum * 0.35)
- elif allDayStay > 15:
- discount = apartSum - (apartSum * 0.50)
- if grade == 'positive':
- discount += discount * 0.25
- print(f"{discount:.2f}")
- break
- else:
- if grade == 'negative':
- discount -= discount * 0.10
- print(f"{discount:.2f}")
- break
- if room == 'president apartment':
- roomSum = 35.00
- presidSum = (allDayStay - 1) * roomSum
- if allDayStay <= 10:
- discount = presidSum - (presidSum * 0.10)
- elif allDayStay <= 15:
- discount = presidSum - (presidSum * 0.15)
- elif allDayStay > 15:
- discount = presidSum - (presidSum * 0.20)
- if grade == 'positive':
- discount += discount * 0.25
- print(f"{discount:.2f}")
- break
- else:
- if grade == 'negative':
- discount -= discount * 0.10
- print(f"{discount:.2f}")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement