Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello, having trouble figuring out the calculations properly. Can I get some help solving this problem?? We're going to extend our reservation making system to

Hello, having trouble figuring out the calculations properly. Can I get some help solving this problem?? We're going to extend our reservation making system to incorporate discounts for longer stays. Well be getting the customers number of nights and well also be getting the type of the room, which should be one of the following characters: D Q or K (for Double, Queen, or King). Well do that for two reservations. To be able to advise the user on which reservation they should choose, we're going to have to make some calculations. First we'll need to determine the price per night. Double rooms go for $59 per night, Queen rooms are $69 per night, and King rooms are $79 per night. Then we'll need to determine the discount. For every night over 2, a 15% discount should be applied. For example, if the stay is for 4 nights, then a 30% discount would be applied to the overall price. Finally, we need to let the user know which stay is the cheapest or if they're the same cost. The user should be prompted for a set of two values which represent the number of nights and the room type for the first reservation. The number of nights should be a whole number. The room type should be a single character. The user should enter both values on one line, separated by spaces. The user should then be prompted for the remaining reservation. Example (the highlighted part is what the program displays and the italicized part is the user input): Reservation 1 (#nights type): 3 D

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

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions

Question

How do books become world of wonder?

Answered: 1 week ago

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago