Skip to content

Commit f99aee5

Browse files
Room Rent
Signed-off-by: Chandra Prakash S <[email protected]>
1 parent 3e3a160 commit f99aee5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Session-2/roomrent.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""Problem Description:
2+
Aadi and Tara travel frequently around the world.
3+
Since most of their travels are unplanned they usually book the rooms for stay nearer to the locality they are going to visit.
4+
Functional Description:
5+
In most of the tourist places the room rent is 20% high during peak seasons [April and May].
6+
Can you help them with the Room Rent Estimation Portal using flow control concept that provides the total rent to pay if the details such as Month,Room Rent and Total days of stay are provided?
7+
Constraints:
8+
1≤month≤12
9+
500≤roomrent≤5000
10+
1≤numofdays≤15
11+
Input Format:
12+
The first line of the input has a single integer which corresponds to the number of the month. [ Ex. January is 1, and March is 3].
13+
The second line of the input has a single floating point number which corresponds to the room rent per day.
14+
The third line of the input has a single integer which corresponds to the number of days stayed in the hotel.
15+
Output Format:
16+
Print the total room rent to be paid with two values after decimal point.
17+
Refer sample testcases for Format Specification."""
18+
19+
month = int(input())
20+
room_rent = float(input())
21+
num_of_days = int(input())
22+
23+
if month == 4 or month == 5:
24+
total_rent = room_rent * num_of_days * 1.2
25+
else:
26+
total_rent = room_rent * num_of_days
27+
28+
print("Rs.{:.2f}".format(total_rent))

0 commit comments

Comments
 (0)