Your assignment is to design a TicketManager class that can keep track of the number of seats available in a theaters auditorium. The TicketManager class should have a two-Dimensional array, which has 15 rows and 30 columns for all the seats available in the auditorium, also an array of double to keep track of the price of tickets for each row. Each row has a different price. Use the following UML diagram to design the class: See image.

Program requirements and/or constraints:

You will need to create two files TicketManager.java file, and Assignment8.java file which has the main method.

Your program should read from two files, seatAvailability.txt and seatPrices.txt (they need to be downloaded from the course website.) If your folder is named Assignment8, then they need to be placed within the folder Assignment8. You can write click and save the files.

The size of the 2-D arrays will be decided by NUMROWS and NUMCOLUMNS. In your class, you declare it as:

public class TicketManager {
public static const int NUMROWS = 15;
public static const int NUMCOLUMNS = 30;
………..……
}

The constructor of the TicketManager class needs to initialize the instance variables. To initialize the 2-D array seats, you need to open and read from the file seatAvailability.txt. This file contains 450 characters (15 rows with 30 characters each), indicating all seats that are available. To initialize the 1-D array price, you need to open and read from the file seatPrices.txt. The file contains 15 doubles representing the price for each row. All seats in a given row are the same price, but different rows have different prices. You also need to initialize seatsSold and totalRevenue to be 0.

The requestTickets method checks if the requested seats are available or not. If at least one of the requested seats are not available, it should return false. It returns true otherwise.

The purchaseTickets method changes the seat 2-D array by changing requested seats from # to *. (# means available, * means occupied) It should also update seatsSold and update the value of totalRevenue

The printTickets method prints the purchased tickets using the following format:

***********************************************
* Gammage Theater *
* Row 1 Seat 1 *
* Price: $ 12.50 *
***********************************************
***********************************************
* Gammage Theater *
* Row 1 Seat 2 *
* Price: $ 12.50 *
***********************************************

The displaySeats method displays the content of the 2-D array seats using the following format: Seats

123456789012345678901234567890
Row 1 ##############################
Row 2 #***##########################
Row 3 ##############################
Row 4 ##############################
Row 5 ##############################
Row 6 ##############################
Row 7 ##############################
Row 8 ##############################
Row 9 ##############################
Row 10 ##############################
Row 11 ##############################
Row 12 ##############################
Row 13 ##############################
Row 14 ##############################
Row 15 ##############################
Legend: * = Sold
# = Available

The method displaySalesReport() print the sales report using the following format:

Gammage Sales Report
___________________________
Seats sold: 5
Seats available:
445 Total revenue to date: $57.50

You need to write Assignment8.java file that contains a main method. In Assignment8.java you will do the following: Declare and instantiate a TicketManager object, and then display a menu to the customer. Below is the first menu displayed when the customer starts using your program (Assignment8.java):

ASU Gammage Theater
1. View Available Seats
2. Request Tickets
3. Display Theater Sales Report
4. Exit the Program

The following is an explanation of each menu choice:

View availability Seats: This menu choice displays the seats available to the customer.

Request Tickets: The program should prompt for the number of seats the customer wants to purchase, the desired row number, and the desired starting seat number. If any of the requested seats do not exist, or not available, an appropriate message should be displayed. If the seat exist and are available, an appropriate message should be displayed. If the seats exist and are available, a bill should be provided that lists the number of requested seats, the price per seat in the requested row, and the total price for the seats. Then the program should ask if the customer wishes to purchase these seats.

Number of seats desired (1 - 30):
Desired row (1-15):
Desired starting seat number in the row (1 - 30):

If the customer indicates that they want to buy the requested seats, a TicketManager object should call appropriate methods to handle the sale. See the sample output.

Display Theater Sales Report: When the user selects option 3 from the menu, the program displays a report that tells how many seats have been sold, how many are still available, and how much money has been collected so far for the sold seats.

Exit the Program: Leaves the menu and quit the program.

Sample runs: User input is represented by bold

ASU Gammage Theater
1. View Available Seats
2. Request Tickets
3. Display Theater Sales Report
4. Exit the Program
1

Seats
123456789012345678901234567890

Row 1 ##############################
Row 2 ##############################
Row 3 ##############################
Row 4 ##############################
Row 5 ##############################
Row 6 ##############################
Row 7 ##############################
Row 8 ##############################
Row 9 ##############################
Row 10 ##############################
Row 11 ##############################
Row 12 ##############################
Row 13 ##############################
Row 14 ##############################
Row 15 ##############################

Legend: * = Sold
# = Available

ASU Gammage Theater
1. View Available Seats
2. Request Tickets
3. Display Theater Sales Report
4. Exit the Program 2 Number of seats desired (1 - 30): 3
Desired row (1-15): 1
Desired starting seat number in the row (1 - 30): 1

The seats you have requested are available for purchase.
The total purchase price is 3 X $12.50 = $37.50

Do you wish to purchase these tickets (Y/N)? y
Num Seats: 3
The price for the requested tickets is $ 37.50 Please input amount paid: $40

***********************************************
* Gammage Theater *
* Row 1 Seat 1 *
* Price: $ 12.50 *
***********************************************

***********************************************
* Gammage Theater *
* Row 1 Seat 2 *
* Price: $ 12.50 *
***********************************************

***********************************************
* Gammage Theater *
* Row 1 Seat 3 *
* Price: $ 12.50 *
***********************************************

Tickets purchased: 3 Payment : $ 40.00
Total ticket price: $ 37.50
Change due : $ 2.50


ASU Gammage Theater
1. View Available Seats
2. Request Tickets
3. Display Theater Sales Report
4. Exit the Program 2 Number of seats desired (1 - 30): 2

Desired row (1-15): 5
Desired starting seat number in the row (1 - 30): 2

The seats you have requested are available for purchase.
The total purchase price is 2 X $10.00 = $20.00

Do you wish to purchase these tickets (Y/N)? y
Num Seats: 2 The price for the requested tickets is $ 20.00
Please input amount paid: $20

***********************************************
* Gammage Theater *
* Row 5 Seat 2 *
* Price: $ 10.00 *
***********************************************

***********************************************
* Gammage Theater *
* Row 5 Seat 3 *
* Price: $ 10.00 *
***********************************************

Tickets purchased : 2
Payment : $ 20.00
Total ticket price: $ 20.00 Change due : $ 0.00

ASU Gammage Theater
1. View Available Seats
2. Request Tickets
3. Display Theater Sales Report
4. Exit the Program
1

Seats
123456789012345678901234567890

Row 1 ***###########################
Row 2 ##############################
Row 3 ##############################
Row 4 ##############################
Row 5 #**###########################
Row 6 ##############################
Row 7 ##############################
Row 8 ##############################
Row 9 ##############################
Row 10 ##############################
Row 11 ##############################
Row 12 ##############################
Row 13 ##############################
Row 14 ##############################
Row 15 ##############################

Legend: * = Sold
# = Available


ASU Gammage Theater
1. View Available Seats
2. Request Tickets
3. Display Theater Sales Report
4. Exit the Program
3

Gammage Sales Report
___________________________

Seats sold: 5
Seats available: 445
Total revenue to date: $57.50

ASU Gammage Theater
1. View Available Seats
2. Request Tickets
3. Display Theater Sales Report
4. Exit the Program 4

Press any key to continue . .
********************************************************************************
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.