Question: 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

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:

--------------------------------------------------------------------

+ NUMROWS : static final int = 15

+NUMCOLUMNS : static final int = 30

-seats[NUMROWS][NUMCOLUMNS] : char

-price[NUMROWS]: double

-int : seatsSold

-double : totalRevenue

==========================

+TicketManager()

+requestTickets(int, int, int): bool

+purchaseTickets(int, int, int) : bool

+getTotalRevenu(): double

+ getSeatsSold() : int

+ getPrice(int) : double

+ getSeat (int, int) : char

+ printTickets(int, int, int): void

-------------------------------------------------------------

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; .. }

Sample Runs:

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: $4

0 ***********************************************

* 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

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!