Answered step by step
Verified Expert Solution
Link Copied!

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 $180 per day. Every additional person is $35 per person per day.
For a deluxe room: the basic charge for up to two travelers is $280 per day. Every additional person is $45 per person per day.
For example, the charge for a regular room for 3 people for 2 days will be $180*2 for the first two travelers and $35*2 for the third traveler, giving total of $430. The charge for a deluxe room for a single person for a single day will be $280. 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 2-4 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

D How will your group react to this revelation?

Answered: 1 week ago