Question: A theater seating chart is implemented as a two dimensional array of ticket prices like this: 10 10 20 20 10 10 20 20 20

A theater seating chart is implemented as a two dimensional array of ticket prices like this:
10 10 20 20
10 10 20 20
20 20 30 30
20 30 30 40
You need to write a JAVA program that prompts users to pick a seat.
Mark sold seats by changing the price to 0. When a user asks for a seat, make sure it is available. If it is not available prompt the user This seat is not available.
First initialize seating matrix using initialization list as shown in the question.
Your program should have 2 methods that:
i) print the array
public static void print_the_array(int myArray[][])
ii) sellSeatByNumber
public static void sell_seat_by_num(int row, int col, int myArray[][])

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!