Question
Umrah and Haj Company is running a promotion for its Umrah packages. It is giving discounts to clients based on the number of people in
Umrah and Haj Company is running a promotion for its Umrah packages. It is giving discounts to clients based on the number of people in each package and the duration of stay in Makkah and Madinah. 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.
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 21.
Number of People in the package | Duration of stay | Package | Normal Price (RM per person) | Discount (%) |
1-2 | 7 days | S | 900 | 3% |
14 days | I | 1500 | 5% | |
21 days | N | 2300 | 7% | |
3-4 | 7 days | D | 850 | 4% |
14 days | O | 1400 | 6% | |
21 days | U | 2100 | 8% | |
5-6 | 7 days | F | 800 | 5% |
14 days | A | 1300 | 7% | |
21 days | Z | 2050 | 9% |
Samples of Input and Output
Sample 1:\
Sample 2:
Enter number of people: 2 Enter duration of stay: 7 -You have selected Package S. You are given a 3 % discount on the total initial amount. The total price for each person after discount is RM 873 The total number of people in this package is 2 persons The total amount to be paid for this package after discount is RM 1746 Enter number of people: 4 Enter duration of stay: 14 You have selected Package 0. You are given a 6 % discount on the total initial amount. The total price for each person after discount is RM 1316 The total number of people in this package is 4 persons The total amount to be paid for this package after discount is RM 5264
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started