A console-based Railway Ticket Booking System developed using Java and Object-Oriented Programming (OOP) concepts.
This project simulates a real-world train reservation system with support for Confirmed Tickets, RAC, and Waiting List management.
- 📄 Book railway tickets with berth preference
- 👵 Priority allocation for senior citizens and female passengers
- 🛏️ Berth types: LOWER, MIDDLE, UPPER
- 🔁 Automatic RAC and Waiting List handling
- ❌ Cancel tickets using Ticket ID
- 🔼 Automatic promotion:
- RAC → Confirmed
- Waiting List → RAC
- 📊 View:
- Confirmed tickets
- Available tickets
- RAC tickets
- Waiting list tickets
- 🧭 Menu-driven console interface
- Java
- OOP Concepts
- Encapsulation
- Abstraction
- Collections Framework
- Java Collections
ArrayListHashMapQueueLinkedList
- Scanner Class for user input
Railway_Booking_System/ │ ├── Main.java ├── TicketSystem.java ├── Passenger.java └── README.md
- User enters passenger details:
- Name
- Age
- Gender
- Berth Preference
- The system tries to allocate:
- Preferred berth
- Lower berth for senior citizens or females
- If no berth is available:
- Ticket goes to RAC
- If RAC is full:
- Ticket goes to Waiting List
- If all are full:
- Booking fails
- Cancelling a confirmed ticket:
- Releases the berth
- Promotes first RAC passenger to Confirmed
- Promotes first Waiting List passenger to RAC
- Java JDK 8 or above
- Any IDE (Eclipse / IntelliJ / VS Code) or Command Line
- Clone the repository:
git clone [https://github.com/saravanakumar-m4/L-Railway-ticket-booking.git]