Week5 MachineProblem1 09062021
Week5 MachineProblem1 09062021
Machine Problem 1
1
Objective/s:
At the end of this activity, you should be able to:
Write a Java program that makes use of two-dimensional array.
Use if-else or switch-case statements.
Apply the corresponding looping statement.
Procedure:
Create a NetBeans project for this activity.
Project Name: MP1_<lastname_firstname>
Example: MP1_Blanco_Maria
The class name should be SeatReservation_<lastname>.
Example: SeatReservation_Blanco
Compress the NetBeans project into .rar or .zip format and then upload to
the link provided in the LMS.
Only NetBeans project will be accepted. Non-compliance will require
resubmission. The highest score for resubmission is 50%.
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.
Assessments
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
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