Question: CREATE A JAVA PROGRAM THAT THE OUTPUT IS SIMILAR TO TH PICTURE BELOW. AND EXPLAIN EACH LINE WHAT IS THE USED OF THAT Write a
CREATE A JAVA PROGRAM THAT THE OUTPUT IS SIMILAR TO TH PICTURE BELOW. AND EXPLAIN EACH LINE WHAT IS THE USED OF THAT


Write a simple bus seat reservation program. The bus has 10 rows, with 4 seats in each row. The program should perform the following: Step 1. The program should ask the user to enter what row and seat number to reserve. Indicate an X mark if the seat is reserved. Step 2. Repeat Step 1; the program will stop until the user enters a negative number. Compile and execute the program. Debug syntax and logical errors, if there are any in the program. Inform your instructor once you are done. The following is the example output: Bus Seat Reservation: Col 1 Row 1 Row 2 Row 3 * Row 4 I * Row 5 I* Row 6 I* Row 7 I* Row 8 Row 9 Row 10 I* Enter row and column number to reserve separated by space (Enter a negative number to exit): 43 Figure 1. First seat reservation sample output Col 2 Col 3 Col 4 Col 3 Col 4 Bus Seat Reservation: Col 1 Col 2 Row 1 I * Row 2 Row 3 Row 4 1 * Row 5 Row 6 Row 7 Row 8 Row 9 Row 10 Enter row and column number to reserve separated by space (Enter a negative number to exit): 4 4 Figure 2. Second seat reservation sample output Col 3 Col 4 Bus Seat Reservation: Col 1 Col 2 Row 1 I Row 2 Row 3 I* Row 4 1* Row 5 Row 6 Row 7 Rowa Row 9 1 Row 10 Enter row and column number to reserve separated by space (Enter a negative number to exit): -1 Program exit! Figure 3. Sample output of reserved seat and exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
