- Displaying output on the console.
- Obtaining input from the console using the Scanner class.
- Using variables to store data.
- Implementing selection control using if statements.
- Implementing selection control using switch statements.
- Writing programs for executing statements repeatedly using loops.
Develop a Java program for managing seat reservations on a small flight. The flight contains 10 seats numbered (11, 12, 21, 22, .., 51, and 52).
Menu Options 1- Reserve a new empty seat. 2- Delete a reserved seat. 3- Delete all reserved seats. 4- Print out the number of reserved seats. 5- Quit.
Reserve a New Empty Seat
- Prompt the user to enter a valid seat number.
- Check if the entered seat number is valid.
- If valid, check if the seat is empty.
- If not empty, prompt the user to re-enter a new seat number.
- If empty, mark it as reserved.
Delete a Reserved Seat
- Prompt the user to enter a valid seat number.
- Check if the entered seat number is valid.
- If valid, check if the seat is reserved.
- If empty, prompt the user to re-enter a new seat number.
- If not empty, mark it as not reserved.
Delete All Reserved Seats
- Mark all seats as not reserved.
Print out Number of Reserved Seats
- Display the number of reserved seats. Quit
- Exit the program execution.