This Plane Management Application is a simple console-based program for managing seat bookings on a plane. It allows users to perform various operations such as buying a seat, canceling a seat, finding the first available seat, showing the seating plan, printing ticket information, and searching for specific ticket details.
- Buy a Seat: Users can purchase a seat by providing the row letter and seat number.
- Cancel a Seat: Users can cancel a previously purchased seat.
- Find First Available Seat: The application will find and display the first available seat.
- Show Seating Plan: Displays the current seating arrangement with available and occupied seats.
- Print Ticket Information and Total Sales: Displays all sold tickets and the total sales amount.
- Search Ticket: Users can search for ticket details by providing the row letter and seat number.
- Java Development Kit (JDK) installed on your machine.
- A code editor or an Integrated Development Environment (IDE) such as IntelliJ IDEA, Eclipse, or Visual Studio Code.
Upon running the application, a menu will be displayed with the following options:
****************************************************
* Menu Option *
****************************************************
1) Buy a Seat
2) Cancel a Seat
3) Find First Available Seat
4) Show Seating Plan
5) Print Ticket Information and Total Sales
6) Search Ticket
0) Quit
****************************************************
-
Buy a Seat:
- Prompts for the row letter and seat number.
- Prompts for ticket holder's name, surname, and email.
- Displays a confirmation message if the seat is successfully purchased.
-
Cancel a Seat:
- Prompts for the row letter and seat number.
- Displays a confirmation message if the seat is successfully canceled.
-
Find First Available Seat:
- Displays the first available seat.
-
Show Seating Plan:
- Displays the current seating arrangement with
O
for available seats andX
for occupied seats.
- Displays the current seating arrangement with
-
Print Ticket Information and Total Sales:
- Displays all sold tickets and the total sales amount.
-
Search Ticket:
- Prompts for the row letter and seat number.
- Displays the ticket details if the seat is found.
-
Quit:
- Exits the application.
This is the main class containing the main method and the core functionalities of the application.
Represents a ticket with attributes for row letter, seat number, price, and the ticket holder's information.
Represents a person with attributes for name, surname, and email.
- Main Method: Initializes the seats and displays the menu for user interaction.
- displayMenu: Displays the menu options.
- buySeat: Handles the seat purchase process.
- cancelSeat: Handles the seat cancellation process.
- findFirstAvailable: Finds and displays the first available seat.
- showSeatingPlan: Displays the current seating plan.
- printTicketsInfo: Displays sold tickets and total sales.
- searchTicket: Searches and displays ticket details based on the seat number and row letter.
Feel free to contribute to the project by submitting pull requests. Please ensure your code follows the existing coding style and includes relevant comments and documentation.
This project is licensed under the MIT License. See the LICENSE file for details.
- This project is a simple educational example for managing plane seat bookings using Java.
Feel free to reach out with any questions or suggestions!
Happy Coding!