Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java programming, implement a cinema seating chart as a two-dimensional array of ticket prices: {10, 10, 10, 10, 10, 10, 10, 10, 10, 10}

In Java programming, implement a cinema seating chart as a two-dimensional array of ticket prices: {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 -8, -8

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 -8,-8

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

What leadership style would best characterize Adam Neumann?

Answered: 1 week ago