Assignment Purpose
The purpose of this lab is to write a well commented javaprogram that demonstrates the use of two dimensional arrays, inputvalidation, and methods. (Write by Java Code, NeedComment)
Instructions
- A theater seating chart is implemented as a two-dimensionalarray of ticket prices, like this:
Seat Ticket Price
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 40 50 50 50 50 50 50 40 20
80 50 50 80 80 80 80 50 50 30
Seating Arrangement: Seats No.
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
- Write a program that prompts the user to pick a price. When auser specifies a price, make sure it is available. Mark sold seatsby changing the price to 0. You will write at least 3 methods.
- One method that reads, validates and returns the price.
- The other that checks whether a seat is available thatprice.
- The third method prints a confirmation if the seat is availableor prints a message saying “A seat at this price is not available.Good Bye.â€
Hint: Basically, you will search the 2D array for theinput price, and as soon as you find a matching price, you willreplace the price at that location with a 0.
Sample output 1
Please pick a price or press Q to quit: 80
     Checking for theavailability……
     Your seat is confirmed! Your seatnumber is 81. Enjoy your movie
Please pick a price or press Q to quit: 80
     Checking for theavailability……
     No seat at this price isavailable. Sorry!
Please pick a price or press Q to quit: Q
    Thank you for using our online ticketingservice. Goodbye!
Sample output 2
Please pick a price or press Q to quit: 10
     Checking for theavailability……
     Your seat is confirmed! Your seatnumber is 1. Enjoy your movie
Please pick a price or press Q to quit: 20
     Checking for theavailability……
     Your seat is confirmed! Your seatnumber is 33. Enjoy your movie
Please pick a price or press Q to quit: 20
     Checking for theavailability……
     Your seat is confirmed! Your seatnumber is 34. Enjoy your movie
     Please pick a price or press Q toquit: 200
     Please pick a valid price. Validprices are $10, $20, $30, $40, $50, and $80
Please pick a price or press Q to quit: Q
Thank you for using our online ticketing service. Goodbye!