Question: JAVA Plz Problem 9: Seating Chart A theater seating chart is implemented as a two-dimensional array of ticket prices, like this: (FRONT/STAGE) 40, 50, 50,

JAVA Plz Problem 9: Seating Chart A theater seating chart is implementedJAVA Plz

Problem 9: Seating Chart A theater seating chart is implemented as a two-dimensional array of ticket prices, like this: (FRONT/STAGE) 40, 50, 50, 50, 40 30, 40, 40, 40, 30 20, 30, 30, 30, 20 10, 20, 20, 20, 10 10, 10, 10, 10, 10 (BACK) Implement a class Seating Chart that represents these seats and allows purchasing an individual seat by price or by specific seat location. Seatingchart must implement the following public methods (you may also include any private methods/fields that you want): String getSeatingChart() // Returns a string that represents the price of seats in a grid-like pattern (see below examples) void sellSeatByPrice (int price) // Goes from left to right and front to back to find a seat with the specified price, then, if found, sets its price to o to mark it as sold. If no seat is found with the specified price, the seating chart remains unchanged. Assume all inputs are valid ints. void sellSeatByNumber(char row, int seat) // Marks the specified seat as sold by setting its price to 0. If the seat doesn't exist, the seating chart remains unchanged. Valid rows are A through E, case sensitive (A is the front row, E is the back row). Valid seats are 1 through 5 (if facing the front/stage, 1 is the leftmost seat, 5 is the rightmost seat). Assume all inputs are valid chars and ints. Examples: SeatingChart chart = new SeatingChart(); chart.getSeatingChart(); // above returns: 40 50 50 50 40 30 40 40 40 30 20 30 30 30 20 10 20 20 20 10 10 10 10 10 10 chart.sellSeatByNumber('D', 5); chart.seliSeatByNumber('B', 2); chart.sellSeatByNumber('b', 3); chart.sellSeatByPrice (10); chart.sellSeatByPrice (10); chart.sellSeatByPrice (30); chart.getSeatingChart(); // above returns: 40 50 50 50 40 0 0 40 40 30 20 30 30 30 20 0 20 20 20 0 0 10 10 10 10

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!