Write a C++ program for an Airline TicketPrice Calculation based on the following scenario. The calculation for the price of the ticket is according to the selected route and after deduction from the following 3 discount categories.1. Early orderdiscount2. Membership card discount3. Children Below 12 years discount
Your C++ program must have a main program and use two Classes for Customer and Ticket. Customer Class should contain information such as Name, Age and Membership. Ticket Class should contain information such as Price, OrderDuration and Discount. Your Ticket Class should contain methods to calculate discount and to calculate the ticket selling price.
Ticket Price Table
Route From To Base Price
1 Kuala Lumpur London RM2000
2 Kuala Lumpur Hong Kong RM1000
3 Kuala Lumpur Jeddah RM1500
Discount Categories
1. Early order discount
- Order date> 60 days, discount 15%
- 60days >=Order date >= 30 days, discount 10%
- Order date< 30 days, no discount.
2. Membership card discount
- Additional 5%discount
3. Children Below 12 years discount
- 20% from the ticket price.
Selling Ticket Price = Base Price – Discount
Example#1
1 adult order ticket for Route#1. He orderedthe ticket 31 days earlier than the travel date. He has a membership card.
Base ticket price for Route#1 is RM2000.
Total discount in percent = 10% + 5% = 15%
Total discount in RM = RM2000 * 15% = RM300
Selling Ticket Price = RM2000 – RM300 =RM1700.
Example#2
An 11 year old child, order ticket for Route#2. He ordered theticket 65 days earlier than the travel date. He has a membership card.
Base ticket price for Route#2 is RM1000.
Total discount in percent = 15% + 5% + 20% = 40%
Total discount in RM = RM1000 * 40% = RM400
Selling Ticket Price = RM1000 – RM400 =RM1700.