• Write a Java program that makes use of two-dimensional array. • Use if-else or switch-case statements. • Apply the corresponding looping statement. Program Specification: 1. Use two-dimensional array with size 7 columns and 5 rows. 2. Seat numbers are populated during run-time and not hard-coded. 3. User is asked to input a seat number. 4. The chosen seat number is replaced by the letter X. 5. Program displays a remark "Seat successfully reserved" when reservation is done. 6. The user is not allowed to reserve a previously reserved seat. Display "Seat is taken" remarks. 7. The user is not allowed to enter an invalid seat number. Display an error message. 8. The program continuously loops. Sample Output: 1 2 8 3 4 6 7 9 15 10 17 24 31 11 18 25 12 19 26 33 13 20 27 14 21 28 16 23 30 22 29 32 34 35 Enter seat number to reserve: 11 1 2 4 5 6 7 14 8 9 15 16 10 17 12 19 13 20 18 21 22 29 23 30 24 31 25 32 26 33 27 34 28 35 Enter seat number to reserve:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Instruction: Create a Java programming code that:

Use if-else or switch-case statements.
Apply the corresponding looping statement.

 

Program Specification:
1. Use two-dimensional array with size 7 columns and 5 rows.
2. Seat numbers are populated during run-time and not hard-coded.
3. User is asked to input a seat number.
4. The chosen seat number is replaced by the letter X.
5. Program displays a remark “Seat successfully reserved” when reservation is done.

6. The user is not allowed to reserve a previously reserved seat. Display “Seat is
taken” remarks.
7. The user is not allowed to enter an invalid seat number. Display an error
message.
8. The program continuously loops.

Sample Output:

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
Enter seat number to reserve: 11
1 2 3 4 5 6 7
8 9 10 X 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35
Enter seat number to reserve:

• Write a Java program that makes use of two-dimensional array.
• Use if-else or switch-case statements.
• Apply the corresponding looping statement.
Program Specification:
1. Use two-dimensional array with size 7 columns and 5 rows.
2. Seat numbers are populated during run-time and not hard-coded.
3. User is asked to input a seat number.
4. The chosen seat number is replaced by the letter X.
5. Program displays a remark "Seat successfully reserved" when reservation is
done.
6. The user is not allowed to reserve a previously reserved seat. Display "Seat is
taken" remarks.
7. The user is not allowed to enter an invalid seat number. Display an error
message.
8. The program continuously loops.
Sample Output:
1
2
3
4
7
8
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
Enter seat number to reserve: 11
1
3
4
7
8
9.
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Enter seat number to reserve:
Transcribed Image Text:• Write a Java program that makes use of two-dimensional array. • Use if-else or switch-case statements. • Apply the corresponding looping statement. Program Specification: 1. Use two-dimensional array with size 7 columns and 5 rows. 2. Seat numbers are populated during run-time and not hard-coded. 3. User is asked to input a seat number. 4. The chosen seat number is replaced by the letter X. 5. Program displays a remark "Seat successfully reserved" when reservation is done. 6. The user is not allowed to reserve a previously reserved seat. Display "Seat is taken" remarks. 7. The user is not allowed to enter an invalid seat number. Display an error message. 8. The program continuously loops. Sample Output: 1 2 3 4 7 8 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 Enter seat number to reserve: 11 1 3 4 7 8 9. 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Enter seat number to reserve:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education