Question: *** WRITE C++ Code *** Hotel Pearl is running a promotion for its room reservation packages in conjunction with Visit Malaysia 2021. It is giving

 *** WRITE C++ Code *** Hotel Pearl is running a promotionfor its room reservation packages in conjunction with Visit Malaysia 2021. Itis giving discounts to hotel guests based on the number of guests

*** WRITE C++ Code ***

Hotel Pearl is running a promotion for its room reservation packages in conjunction with Visit Malaysia 2021. It is giving discounts to hotel guests based on the number of guests in a room and the duration of stay at the hotel. Using the information given in the following table, write a C++ program that accepts from the users, the number of guests per room and the duration of stay, to determine and display the type of promotion package, the discount value, and the total price for each package after discount. Hint: Use your preferred nested selection to solve this problem. Please notice the following 1. Your program should only accept valid number of people based on the below table. Otherwise, you should display "Invalid entry. Please enter a value between 1-6 people only" 2. Similarly, your program should check the input of the duration of stay within the range given in the table below and display the following message if the input is invalid. "Invalid entry. Duration of stay must be at least 1 and not more than 7". Package Normal Price Discount (%) Number of guest(s) Duration of stay (days) (RM per room) 1-2 1-2 M 300 13% 3-5 N 400 15% 6-7 0 500 17% 3-4 1-2 P 400 14% 3-5 Q 500 16% 6-7 R 600 18% 5-6 1-2 S 700 14.5% 3-5 T 800 16.5% 6-7 U 850 18.5% Enter number of guest(s): 0 Invalid entry. Please enter a value between 1-6 people only. Enter number of guest(s): 7 Invalid entry. Please enter a value between 1-6 people only. Enter number of guest(s): 5 Enter duration of stay: -1 Invalid entry. Duration of stay must be at least 1 and not more than 7. Enter duration of stay: 11 Invalid entry. Duration of stay must be at least 1 and not more than 7. Enter duration of stay: 2 You have selected Package S. You are given a 14.5 % discount on the hotel reservation. The total price for this package after discount is RM 598.5 The total duration of stay in this package is 2 days The total amount to be paid for this package after discount is RM 1197 Enter number of guest(s): 2 Enter duration of stay: 4 You have selected Package N. You are given a 15 % discount on the hotel reservation. The total price for this package after discount is RM 340 The total duration of stay in this package is 4 days The total amount to be paid for this package after discount is RM 1360

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!