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”.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.3: Nested If Statements
Problem 7E
icon
Related questions
Question

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.

  1. 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".
  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”.

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%
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Algebraic Expressions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr