You are to create a C++ program that enables a person to make a reservation at t
ID: 3625184 • Letter: Y
Question
You are to create a C++ program that enables a person to make a reservation at the Cancun Mexican Resort.
1. The program should be controlled by a main loop that lets the user answer Y or N to the question,
•“Do you want to make another reservation? Y/N” If they answer with a lower case y or a capital Y, the program continues, else the program ends.
2. Next, a menu as shown below should be displayed using a do while loop.
Before the menu is displayed, use the system (“cls”) command to clear the screen so the menu comes up nice and clean.
Welcome to the Cancun Mexicana Resort!
Please select the room type of your choice
*****************************************************
1. King Suite ($280.00)
2. 2 Queen Beds Suite ($310.00)
3. King Standard Room ($235.00)
4. 2 Queen Beds Standard Room ($255.00)
*****************************************************
•If the user enters anything outside the range of 1-4, they should get a message to that effect and be required to enter the menu option again. They should not be able to proceed with the rest of the program until they have entered the correct information.
3. Once they correctly enter one of the menu numbers, they should be asked for the number of nights.
•Please enter the number of nights. Must be greater than 0.
•If the number entered is not greater than 0 then tell the user this and do not let them continue until they have entered a number greater than 0.
4. Next ask them to enter the currency type.
•Please enter the currency type: A for American or P for Pesos
•If the currency type is not an a or p, make them enter it again until they enter an a or a p. It should not matter if the currency type is a capital a or p.
5. Next ask them if they need ground transportation.
•Do you need ground transportation Y/N? Bus available for 15.00 day
?If they do not enter a y or n, do not let them continue until they enter the correct letter.
•If they answer y or Y, ask them for the number of days.
?How many days do you want transportation - must be greater than zero?
?If the number entered is not greater than zero, force them to stay there until the number entered is greater than zero.
6. Next you ask them if they want a bus tour?
Do you want a bus tour Y/N? Available daily 10.00
Again, validate to make sure they answer with a y or n.
If Y or y, the bus tour total of 10.00 will be included in a variable.
Calculations & Functions
7. Room rate amounts (280.00, 310.00, 235.00 and 255.00) and tax (.15) should be declared as constants.
8. Using a switch structure use the menu options as the case numbers. Example, case 1 would be King Suite($280.00) and so on. This structure should determine the room fee and the room type based on the menu option.
9. Call the function getRoomTotal where you will send the room fee, the currency type (a or P) and the number of nights
?If the currency type is an A or a,
room total = room price * number of nights * 1
?If the currency type if a P or p,
room total = room price * number of nights * 10.5644.
**Note** We are using 10.5644 as the currency conversion rate for Pesos. At any one time it could change. We are using this rate because it keeps everyone’s programs consistent.
10. Get the final total by calling a function called getFinalTotal . You need to pass the variables that include the room total, tax, days of transportation and if they are going on a bus tour.
?In the function, getTotal you will be using the following calculations.
?Calculate the room tax by multiplying the room total * .15
¦If the variable for bus tour is a y or Y,
final total is equal to room total+ room tax + days of transportation times 15.00 plus 10.00.
¦If the variable for bus tour is not equal to y or Y,
final total = room total+room tax+days of transportation times 15.00
11. Display the reservation information by calling a function called displayInformation. You will pass the number of days, room total, room tax, days of transportation, bus tour, room type , final total, currency type.
The final results should be displayed as follows:
**************************************************************************
Number days you are staying: 2
Room Type: King Suite
Currency type: American
Tax on room only: 84.00
Room Total only: 560.00
____________________________________________________
Transportation Cost: 30.00
Bus tour: 10.00
____________________________________________________
Total: 684.00
¦After this function you should ask the user if they would like to make another reservation.
¦The initial variables should be reset to their initial values so the user can enter another reservation.
Explanation / Answer
please rate - thanks
loop
get room type
get number of nights
get type of currency
get if wants transportation
if yes
get number of days
get if wants bus tour
get roomtotal from rate, currency and number of nights
get final total from roomtotal, tax, days transportation, and if wants tour)
print summary
ask if wants another reservation
if yes
go to loop
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.