A command-line-based Train Reservation System for passengers to book train tickets and for administrators to manage train details.
-
Admin Menu:
- Add train details
- View all trains
- Protected with a hardcoded admin password
-
Passenger Features:
- Sign up with a unique username and password
- Log in to access passenger-specific options
- Book tickets for available trains
- View ticket details
- Change password
-
Admin Access:
- Select the "Admin Login" option.
- Enter the admin password (default:
PASSWORD). - Manage train details through the admin menu.
-
Passenger Access:
- Sign up using a unique username and password.
- Log in to book tickets, view reservations, or change the password.
-
Ticket Booking:
- Enter the train number to book a ticket.
- Provide passenger details and class type.
- Reservation number is generated automatically.
trains.dat: Stores train details.tickets.dat: Stores ticket reservations.users.dat: Stores user credentials.
- C++ compiler (e.g., GCC)
- Basic knowledge of command-line operations
- Compile the program:
g++ -o TrainReservationSystem main.cpp
- Run the program:
./TrainReservationSystem
- Hardcoded admin password:
PASSWORD(can be modified in the source code). - Train and ticket data are stored in binary files for persistence.
- For input validation and a smooth user experience, ensure correct data entry.
- No GUI; this is a command-line application.
- Train and ticket records are not encrypted.
- Limited input validation.
- Add encryption for stored data.
- Implement dynamic admin password management.
- Include a graphical user interface (GUI).
- Expand features for advanced ticket management.