Question
In Java programming, implement a cinema seating chart as a two-dimensional array of ticket prices, like this: {10, 10, 10, 10, 10, 10, 10, 10,
In Java programming, implement a cinema seating chart as a two-dimensional array of ticket prices, like this: {10, 10, 10, 10, 10, 10, 10, 10, 10, 10} {10, 10, 10, 10, 10, 10, 10, 10, 10, 10} {10, 10, 10, 10, 10, 10, 10, 10, 10, 10} {10, 10, 20, 20, 20, 20, 20, 20, 10, 10} {10, 10, 20, 20, 20, 20, 20, 20, 10, 10} {10, 10, 20, 20, 20, 20, 20, 20, 10, 10} {20, 20, 30, 30, 40, 40, 30, 30, 20, 20} {20, 30, 30, 40, 50, 50, 40, 30, 30, 20} {30, 40, 50, 50, 50, 50, 50, 50, 40, 30} The program should enable the user to choose ticket by choosing coodinates or by choosing price. After booking, the price of that seat should be equal to zero. Named the class as Cinema and use the followings in the class: Private seatsPrices: [9][10]
Public Cinema() (constructor, set private variable to the given values) Public controlAvailabilityOfTicket(int x, int y): boolean Public bookSeat (int x, int y): void Public AccordingToPrice(int price): int[2]
For the driver code outcome should be as below: (f there is no available seat with the given price, coordinates should be 100, 100.
Press:
1 To choose your place according to seat coordinates
2 to choose your place according to price Where do you want to sit?
1
Write coordinates please.
2
1
The place is reserved at 2.1
Is there anyone who would you like to get a ticket?(Y/N)
Y
Press:
1 To choose your place according to seat coordinates
2 To choose your place according to price
2
Please enter the price of the seat that do you want to sit.
30
The place is reserved 6,2
Is there anyone who would you like to get a ticket? (Y/N)
Y
Press:
1 To choose your place according to seat coordinates
2 to choose your place according to price
2
Please enter the price of the seat that do you want to sit.
86
The place is reserved -1,-1
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