Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program that calculates the total charges for booking rooms at a hotel. The hotel charges different prices for a room depending on the
Write a program that calculates the total charges for booking rooms at a hotel. The hotel charges different prices for a room depending on the type of room, the number of people and the number of days according to the following policy:
For a regular room: the basic charge for up to two travelers is $ per day. Every additional person is $ per person per day.
For a deluxe room: the basic charge for up to two travelers is $ per day. Every additional person is $ per person per day.
For example, the charge for a regular room for people for days will be $ for the first two travelers and $ for the third traveler, giving total of $ The charge for a deluxe room for a single person for a single day will be $ See sample run below.
Specifically, write a program that
Welcomes the user to the Bellevue Inn.
Asks the user for
the type of the room ASSUME USER ENTERS VALID INPUT: R r D or d
the number of travelers ASSUMER USER ENTERS A POSITIVE INTEGER
the number of days ASSUMER USER ENTERS A POSITIVE INTEGER
No need to validate inputs
Prints the charge for that room and the total charge so far.
Prompts the user if she wants to continue with more input.
If user enters y or Y repeats steps again, otherwise, ends the program by printing the final total charge and prints Bye
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started