A comprehensive Java console application for managing airline seat reservations
Developed as part of Software Development II coursework (4COSC005W)
This application simulates a plane seat management system with a 4-row aircraft configuration. It provides a complete solution for managing seat reservations, passenger information, and ticket generation with persistent file storage.
- Course: Software Development II (4COSC005W)
- University: University of Westminster
- Academic Year: 2023-2024
- Student ID: 20231280_w2052016
| Row | Seats | Configuration |
|---|---|---|
| A | 14 seats | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
| B | 12 seats | 1 2 3 4 5 6 7 8 9 10 11 12 |
| C | 12 seats | 1 2 3 4 5 6 7 8 9 10 11 12 |
| D | 14 seats | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Total Capacity: 52 seats
Row A: O O O O O O O O O O O O O O (14 seats)
Row B: O O O O O O O O O O O O (12 seats)
Row C: O O O O O O O O O O O O (12 seats)
Row D: O O O O O O O O O O O O O O (14 seats)
O= Available |X= Booked
- Seat Booking - Reserve seats with complete passenger information
- Seat Cancellation - Cancel existing reservations with validation
- Availability Search - Find first available seat across all rows
- Seating Plan Display - Real-time visual representation of seat status
- Ticket Management - Search and display comprehensive ticket information
- Sales Reporting - Calculate total revenue and generate sales reports
- Object-Oriented Design - Separate classes for Person, Ticket, and Main logic
- Input Validation - Comprehensive validation with error handling
- File Persistence - Automatic ticket file generation and storage
- Exception Handling - Robust error management throughout the application
- Memory Management - Efficient array-based data structures
- User Interface - Intuitive console-based menu system
- Email Validation - Format checking with
@and.requirements - Seat Range Validation - Row and seat number boundary checking
- Input Type Validation - Try-catch blocks for numeric inputs
- Duplicate Booking Prevention - Prevents double-booking of seats
- Empty Field Validation - Ensures all required fields are completed
*****************************************************
* MENU OPTIONS *
*****************************************************
1) Buy a seat
2) Cancel a seat
3) Find first available seat
4) Show seating plan
5) Print tickets information and total sales
6) Search ticket
0) Exit
*****************************************************
Please select an option:
O O O X O O O O O O O O O O
O X O O O O O O O O O O
O O O O O O O O O O O O
O O O O O O O O O O O O O O
Ticket Information
Row: A
Seat: 1
Price: 200.0
Ticket Holder Information
Name: John
Surname: Doe
Email: john.doe@email.com
Java JDK 8 or higher
IDE (IntelliJ IDEA, Eclipse, or VS Code)
Operating System (Windows, macOS, or Linux)
-
Clone the repository
git clone https://github.com/dula089/plane-seat-management-system.git cd plane-seat-management-system -
Navigate to source directory
cd src -
Compile the Java files
javac *.java -
Run the application
java _20231280_w2052016_Planemanagement
plane-seat-management-system/
├── 📂 src/
│ ├── 📄 _20231280_w2052016_Planemanagement.java # Main application
│ ├── 📄 Person.java # Person entity
│ └── 📄 Ticket.java # Ticket entity
├── 📂 docs/
│ └── 📄 coursework.pdf # coursework
├── 📄 A2.txt # Generated ticket files
├── 📄 README.md # This file
├── 📄 .gitignore # Git ignore rules
└── 📄 LICENSE # License information
| Option | Function | Description |
|---|---|---|
1 |
Buy a seat | Book a new reservation with passenger details |
2 |
Cancel a seat | Cancel an existing seat reservation |
3 |
Find first available | Locate the next available seat |
4 |
Show seating plan | Display current seat status visually |
5 |
Print tickets info | Show all booked tickets and total sales |
6 |
Search ticket | Find and display specific ticket information |
0 |
Exit | Close the application safely |
- Select Option 1 from the main menu
- Enter Row Letter (A, B, C, or D)
Enter row(A/B/C/D): A - Enter Seat Number (varies by row: A&D=1-14, B&C=1-12)
Enter seat number: 5 - Provide Passenger Information:
Enter your name: John Enter your surname: Doe Enter your email: john.doe@email.com - Confirmation & File Generation
Seat successfully booked. Ticket information saved to file: A5.txt
# Search by seat location
Enter row(A/B/C/D): B
Enter seat number: 7
# Returns complete ticket and passenger information# Displays all tickets and calculates total revenue
Tickets Information
Row: A, Seat: 1, Price: £200.00
Row: B, Seat: 7, Price: £150.00
Total Sales: £350.00