Question
Write a program that can be used by a small theater to sell tickets for performances. The theaters auditorium has 15 rows of seats, with
Write a program that can be used by a small theater to sell tickets for performances. The theaters auditorium has 15 rows of seats, with 30 seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, seats that are taken are represented by an * symbol, and seats that are available are represented by a # symbol.
Requirements:
When the program begins initialize the prices array with the following data. Tickets prices are based on the row as follows:
Row 1 $85.00
Row 2 $85.00
Row 3 $85.00
Row 4 $80.00
Row 5 $80.00
Row 6 $75.00
Row 7 $75.00
Row 8 $70.00
Row 9 $70.00
Row 10 $60.00
Row 11 $60.00
Row 12 $50.00
Row 13 $40.00
Row 14 $30.00
Row 15 $20.00
Once prices are set, display a seating chart. The user may enter the row and seat numbers for tickets being sold. Every time a ticket or group of tickets is purchased, the program should display the total ticket prices and update the seating chart.
The program should keep a total of all ticket sales. The user should be given an option of viewing this amount.
The program should give the user an option to see a list of how many seats have been sold, how many seats are available in each row, and how many seats are available in the entire auditorium.
Validation: When the tickets are being sold, do not accept row or seat numbers that do not exist. When someone requests a particular seat, the program should make sure that seat is available before it is sold.
You may use two global constants; rows and columns. No other global constants may be utilized.
----------------------------------------------------------------------------------------------------------------------------
Use these functions as guidelines. (Other designs are acceptable as long as the program is complete, logical and accurate.)
main - Use a two-dimensional char array with 15 rows and 30 columns to represent the seating chart. Initialize each element in the array with the # symbol. Get the seat prices from the input file and store in a one-dimensional array. In a loop, display the menu, get the user choice and call the correct function based on the user choice.
display menu - displays the menu options
View Available Seats
View Seating Prices
View Ticket Sales
Purchase a Ticket
Exit the Program
get choice - inputs, validates and returns the users choice from the menu. This function is a value returning function.
display seats - displays a chart showing sold and available seats. This function accepts the seating chart (2D array) as an argument.
display prices - displays the ticket prices for each row. This function accepts the price array as an argument.
purchase ticket - handles ticket purchases. This function is a void returning function which accepts the seating chart, price array and total sales as arguments. Give the user the option of viewing the available seats before making the selection. Prompt to enter the row and seat number. Check for availability. If the seat is available, mark the seat as taken, updates ticket total and total price, provide a user friendly message and give the user the option of purchasing another ticket. If the seat is not available, provide a user friendly message and give the user the option of purchasing another seat. When the user is done purchasing, display a purchase summary including the total number of tickets, total price for this transaction and update the theater total purchases.
display sales - displays the total sales in formation. This is a void returning function which displays the total sales for the theater to date.
Add an option to the menu to find the best available seating. Ask the user how many tickets to purchase and provide the user with the best seats available for that size group. For example, if the user wants to purchase 4 tickets, search the seating chart and find the row closest to the front and the middle with 4 seats available together.
Thank you!!!!!
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