Question: C++ Write a program that can be used by a small theater to sell tickets for performances. The theaters auditorium has 15 rows of seats,

C++

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, the following screen shows a chart depicting each seat in the theater. Seats that are taken are represented by a # symbol, and seats that are available are represented by a - symbol: You will read the input file tickets.txt to read the initial condition of the theater. In the file, each line will represent one seat by a row and column number. For instance, if the file content is as follows: 10 15 5 20 8 13 This means three tickets were sold. And the seat location of the first ticket is 10th row and 15th column. The location of the second seat is 5th row and 20th column. And the location of the third seat is 8th row and 13th column. Your program starts with showing a menu to the user. In the menu there will be 5 options as follows: 1. View Current Seats a. This menu will show the current seat conditions as shown in the above figure. 2. Sell Ticket a. Program will ask user the row and column number of the seat. And it will mark that seat as sold. (Also, provide a warning message if the seat was already sold) 3. Refund Ticket a. It will ask user to enter row and column number. If the seat was sold, it will mark it unsold. (Also, provide a warning message if the selected seat was not sold yet) 4. Save Data File a. It will save the current seat conditions back into the tickets.txt file using the same format. 5. Exit Program a. Exits the program

tickets.txt

4 3 5 19 6 16 11 30 9 29 15 26 10 29 7 18 13 25 3 12 9 2 4 11 10 24 5 23 13 10 15 5 12 19 11 17 5 24 5 23 8 19 14 27 5 18 6 22 13 27 1 15 5 21 15 8 4 28 8 23 11 4 2 12 4 7 6 28 15 21 9 18 4 3 6 15 2 19 4 11 11 11 3 1 2 14 8 8 13 12 4 13 9 11 14 27 10 11 15 24

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!