Cherating Company is running a promotion for its tour packages. It is giving discounts to clients based on the number of people in each package and the duration of stay in Cherating Hotel. Using the information given in the following table, write a C++ program that accepts from the users the number of people per package 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. Your program should only accept a valid number of people based on the below table. Otherwise, you should display "Invalid entry. Please enter a value between 1-9 people only". 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”.
Cherating Company is running a promotion for its tour packages. It is giving discounts to clients based on the number of people in each package and the duration of stay in Cherating Hotel. Using the information given in the following table, write a C++ program that accepts from the users the number of people per package 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.
- Your program should only accept a valid number of people based on the below table. Otherwise, you should display "Invalid entry. Please enter a value between 1-9 people only".
- 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”.
Number of People in the package |
Duration of stay |
Package |
Normal Price (RM per person) |
Discount (%) |
1-3 |
2 days |
‘A’ |
700 |
4% |
|
4 days |
'B' |
1200 |
6% |
|
6 days |
'C' |
1800 |
8% |
4-6 |
2 days |
‘D’ |
650 |
5% |
|
4 days |
'E' |
1100 |
7% |
|
6 days |
'F' |
1700 |
9% |
7-9 |
2 days |
‘G’ |
600 |
6% |
|
4 days |
'H' |
1000 |
8% |
|
6 days |
'I' |
1600 |
10% |
Step by step
Solved in 2 steps with 1 images