Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CREATE A JAVA PROGRAM Write a simple bus seat reservation program. The bus has 10 rows, with 4 seats in each row. The program should

CREATE A JAVA PROGRAM

image text in transcribed

image text in transcribed

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

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

Step: 3

blur-text-image

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

1. What are the marketing implications of this situation?

Answered: 1 week ago