Create a program that keeps track of ticket sales for an auditrorium. A concert
ID: 3634412 • Letter: C
Question
Create a program that keeps track of ticket sales for an auditrorium. A concert will be performed over three days in an auditorium with
three levels of seating – ?oor, balcony, and upper balcony. There are 20
seats for each type of seating. Write a program that initilizes all seats
the the ”*” character. Allow a user to request a seat for a particular seat
assignment area on a speci?c day. Use a three-dimensional array to keep
track of the ticket sales. The ?rst dimension indicates the performance
day: T for Thursday, F for Friday, and S for Saturday. The second
dimension indicates the type of seating: F for ?oor, B for balcony, and U
for upper balcony. The third dimension indicates if a seat is sold, using S
for sold.
The ?oor seats sell for $30, the balcony seats sell for $20, and the upper
balcony seats sell for $10 each. The program must allow input of ticket
requests until X is entered to indicate that no more sales will be made.
After the close of sales, calculate the amount of ticket sales for each performance for each day. Calculate the number of each type of seat sold for
each day. Calculate the total number of seats sold for all performances.
-------------------------------
Generate a list of 100 random integers. Use the selection sort algorithm to sort these numbers.
-------------------------------
Generate a list of 100 random integers. Use the insertion sort
algorithm to sort these numbers. Time the execution of insertion sort
and selection sort using C++’s timing library functions
I need the code in C++.
Explanation / Answer
1. Problem: Ticket Sales A performance center invites you to design and implement a ticket sales system for selling tickets of performances that are hold in the center’s main auditorium. 1.1 The auditorium The center’s auditorium has 15 rows with 30 seats in each row. The seats are categorized in four classes: A, B, C and D. The distribution of the seats in each class is recorded in the seatsConfig.txt file (downloadable). 1.2 Performances Each performance has a performance id, performance title, base price and performance period (start date and end date). Each day can only accommodates one performance. A performance has a fixed base price (the ticket price for a seat in class C, see below). 1.3 Seat prices Seat prices vary from different performances and seat classes. The price for seats in class C for a performance equals to the base price of the performance. The price of the seats in Class A is double of the base price. The price of the seats in Class B is 1.5 times of the base price. The price of the seats in Class D is half of the base price. For instance, if the base price of a performance is $60, the prices for the seats in each class are: Class A: $120 Class B: $90 Class C: $60 Class D: $30 1.4 Tickets A ticket is issued for a specific performance on a specific day for a specific seat. The price of a ticket is determined by the performance and seat class of the ticket. 1.5 Ticket sale Tickets are sold according to their availability. A patron can request for a specific seat with a row and seat number or request for more than one ticket with consecutive seats in a class. 2. Program tasks and specification Task 1: Create a class called performance that records the information of a performance. The class should include at least five data items: id, title, basePrice, startDate, endDate. You can have more data items and methods. Write a class driver to test it. Task 2: Create a class called ticket that records the information of a performance ticket. The class should include at least six data items: performanceId, seatRow, seatNo, class, price, date and at least a method printTicket. You can have more data items and methods. Write a class driver to test it. Task 3: Create a class called auditorium that specifies the seats in the auditorium. The class should include at least one data item: seat (two dimensional array of Char) and at least three methods named: readSeatsConfig, displaySeatsConfig, getSeatClass. You can have more data items and methods. Write a class driver to test it. Task 4: Create a class called ticketSelling that stores booking information of a single performance on a single day and sells the tickets of the performance. The class should include at least three data items: show (of performance class), day (of Date class), and bookkeeper (two-dimensional array or of auditorium class). The class should also include method setPerformance to set the performance details and method sell that is used to sell a ticket with given performance id, day, seat location if available. Note that you might need a private method for checking the availability of a ticket. Write a C++ application with a simple menu to set performance data and print tickets. Task 5: Create a class called ticketManager that can maintain a record of a list of performances and sell available tickets. The class should be able to display seat availability with a chat similar to the following: Performance ID: 1234 Date: 12/12/2009 012345678901234567890123456789 0 BBBBBAAAAAAAAAXXXXXAAAAAABBBBB 1 BBBBBBBAAAAAAAAAAAAAAAABBBBBBB 2 BBBBBXXXXXAAAAAAAAAAABBBBBBBBB 3 CCBBBBBBBBBAAAAAAAABBXXXBBBBCC 4 CCCCBBBXBBBBBAAAABBBBBBBBBCCCC 5 CCCCCCBBBBBBBBAABBBBBBBBCCCCCC 6 CCCCCCCCBBBBXXXBBBBBBBCCCCCCCC 7 CCCCCCCCCCBBBBBBBBBBCCCCCCCCCC 8 CCCCCCCCCCCCBBBBBXXCCCCCCCCCCC 9 CCCCCCXXXXXXCCBBCCCCCCCCCCCCCC 10 DDCCCCCCCCCCCCCCCCCCCCCCCCCCDD 11 DDDDCCCCCCCCCCCCCCCCCCCCCCDDDD 12 DDDDDDCCCCCCCCCCCXXCCCCCDDDDDD 13 DDDDDDDDCCCCCCCCCCCCCCDDDDDDDD 14 DDDDDDDDDDCCCCCCCCCCDDDDDDDDDD where X means that the seat is sold. Task 6: Extend your ticketManager class with the following functionalities: 1. Save and read tickets availability record for all performances to or from a file. 2. Allow a patron to buy more than one tickets without specify seat location. The program should be able to find available consecutive seats for the patron if possible. 3. Produce a sales report for each performance
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.