A C++ console-based transport reservation system that allows users to add buses, make and cancel reservations, and view booking details with file handling. Designed for Programming Fundamentals project.
The Transport Reservation System offers numerous benefits for both passengers and transport companies.
By enabling passengers to book and manage their bus tickets, the system provides a convenient and hassle-free experience.
This not only saves time for passengers but also streamlines the ticketing process and improves efficiency for transport companies.
Additionally, it provides valuable data related to buses, passengers, routes, and schedules.
- To create a comprehensive transport management system.
- To provide a convenient, efficient, and accurate way for passengers to:
- Book and manage transport tickets
- Search for available buses
- View schedules and seat availability
- Receive booking confirmation
- To streamline the ticketing process through automation
- To provide accurate arrival and departure times
This system will allow users to:
- Search for available buses
- View bus schedules, departure and arrival times
- Select seats
- Receive booking confirmations
The system is designed for anyone involved in the transportation system, including:
- Passengers
- Transport companies
- Administrators
- Customer service representatives
It aims to provide a smooth and seamless experience for all types of users.
- 🚌 Add Transport Record: Add ride number, ride name, total seats, and driver name
- 📋 View Transport Details: View single ride or all rides
- ✏️ Update Transport Record: Modify ride details (name, number, driver, seats)
- ❌ Delete Transport Record: Remove a ride by its ID
- 🌍 View Routes: Show predefined routes with arrival and departure times
- 🎫 Book Ticket: Collect booking number, ride number, passenger info, and seat count
- 🔁 Cancel Booking: Cancel a reservation using booking number
Below is the step-by-step logic of the Transport Reservation System implemented in C++ with file handling and vectors.
- Load bus and reservation data from files
- Continuously show the main menu until the user exits
- Take user choice and call the respective function:
- Add New Bus
- View All Buses
- Make Reservation
- View Reservations
- Cancel Reservation
- Search Bus
- Exit
- On exit, save data back to files
- Input: Bus number, driver name, departure & arrival time, locations, total seats
- Validate if bus number is unique
- Add data to vectors
- Initialize seat status vector with
falsevalues (unbooked) - Save data to
buses.txt
- If no buses: Display message
- Else: Display all bus details in a table format
- Input: Bus number
- If valid and has available seats:
- Display all unbooked seats
- Input seat number and validate
- Input passenger name and travel date
- Mark seat as booked (
true) - Decrease available seat count
- Add passenger info to reservation vectors
- Save to
reservations.txt
- If no data: Show message
- Else: Display bus number, passenger name, seat number, travel date
- Input: Bus number and seat number
- If matching record found:
- Mark seat as unbooked (
false) - Increase available seat count
- Remove reservation from vectors
- Save data
- Mark seat as unbooked (
- Else: Show "not found" message
- Two options:
- By Bus Number → Display full bus details if found
- By Route (From → To) → Display all matching buses
buses.txt— Stores all bus datareservations.txt— Stores all booking/reservation data
- Load: When program starts (
main()) - Save: After any change (add, book, cancel)
| Vector Name | Purpose |
|---|---|
busNumbers |
Stores bus numbers |
driverNames |
Stores driver names |
departureTimes, arrivalTimes |
Stores schedule |
fromLocations, toLocations |
Stores route info |
totalSeats, availableSeats |
Tracks capacity |
seatStatus |
Tracks if each seat is booked |
reservationBusNumbers, passengerNames, seatNumbers, travelDates |
Stores reservation details |
- Uses text files for data storage (not scalable)
- No transaction management — not safe for concurrent users
- Command-line interface (no GUI)
- May not perform well under high data load
- Code is not modular, making future updates harder
To improve the Transport Reservation System, we plan to:
-
💬 Add a feedback and rating system for passengers
-
📞 Implement a customer support system for queries and complaints
-
🚗 Expand support for various ride types:
- Tour Buses
- Taxis
- Flights
- Trains
- Inter-city Buses
👩💻 Name: Nasiha Mehmood-ul-Hassan
🎓 Role: BSCS Student, Govt College University Faisalabad (Chiniot Campus)
🔗 LinkedIn: Nasiha Mehmood-ul-Hassan(https://www.linkedin.com/in/nasiha-hassan/))
📧 Email: nasihamehmood206@gmail.com