Write a program called TicketPrices to allow a user to find out the price they have to pay for a ticket for an opera.
The price of a ticket depends on three factors:
Kind of session. There are two kinds of sessions: afternoon session (cheaper) and evening session (more expensive).
Kind of seat. There are three kinds of seats for the opera: stall seat (the least expensive), front of house seat, and gallery seat (the most expensive).
Type of ticket holder. There are two types of ticket holders: concession (with 20% deduction) and non-concession.
The program prompts the user for the kind of session, kind of seat, and type of ticket holder in that order and then displays the price for the ticket. The program must allow the user to cancel the operation at any stage.
The prompts must be exactly as shown in the following sample run (the user inputs are shown in italic):
We will need information on the type of session, the type of seat, and the type of ticket holder.
Options for type of session are:
1. Afternoon session
2. Evening session
x. Cancel
Please enter your choice (1, 2, or x): 3
It is an invalid choice for session. Please try again.
Options for type of session are: 3
1. Afternoon session
2. Evening session
x. Cancel
Please enter your choice (1, 2, or x): 1
Options for type of seat:
1. Stall seat
2. Front of the house seat
3. Gallery seat
x. Cancel
Please enter your choice (1, 2, 3, or x): 3
Options for type of ticket holder:
1. Concession
2. Non-concession
x. Cancel
Please enter your choice (1, 2, or x): 1
The price for the ticket is: $64.00
Thank you for using the program.
Also, whenever the user chooses to terminate the operation (i.e., with option x), the program must show the message Thank you for using the program. before terminating itself.
The prices for non-concession tickets are shown in the following tables:
Stall Seat Front Of House Seat Gallery Seat
=============================================================================
Afternoon Session $40 $50 $80
Evening Session $60 $70 $100
Concession tickets enjoy a 20% deduction; the price is to be rounded down to the nearest dollar value if necessary.