This repository contains the Bus Reservation System Management project developed using Object Oriented Programming (OOP) and File Handling concepts in C++.
- Bus Management: Add, view, and remove bus details.
- Reservation System: Book, view, and cancel reservations.
- File Handling: Persist bus and reservation data using file handling techniques.
- User Interface: Command-line based user interface for interacting with the system.
- Welcome Screen
- Main Menu
- User Menu
- Book Ticket
- Admin Menu
- Bus List
To get started with the development or usage of this project, follow the instructions below:
- A C++ compiler (such as g++, clang++)
- A suitable development environment (such as Visual Studio, Code::Blocks, or a text editor with command line tools)
-
Clone this repository to your local machine:
git clone https://github.com/nixrajput/bus-reservation-system-cpp.git
-
Navigate into the cloned repository directory:
cd bus-reservation-system-cpp
To compile the project, you can use the following command in the terminal:
g++ -o BusReservationSystem main.cpp Bus.cpp Reservation.cpp
#or
clang++ main.cpp -o BusReservationSystem.exe
This command assumes you have main.cpp
, Bus.cpp
, and Reservation.cpp
files. Modify it according to your actual file names.
After successfully compiling the project, you can run the application using the command:
./BusReservationSystem
Username : admin
Password : pass
The project directory typically contains the following files:
main.cpp
: The main entry point of the application.Bus.h
andBus.cpp
: Bus class definition and implementation.Reservation.h
andReservation.cpp
: Reservation class definition and implementation.data/
: A directory containing data files for buses and reservations.utils.h
: A file contains required utility functions.
This class manages bus details and includes the following methods:
void addBus()
: Adds a new bus.void displayBuses()
: Displays all buses.void removeBus()
: Removes a bus by ID.
This class manages reservations and includes the following methods:
void bookTicket()
: Books a new ticket.void viewReservations()
: Displays all reservations.void cancelReservation()
: Cancels a reservation by ID.
Data persistence is achieved using file handling concepts. The bus and reservation data are stored in separate files within the data/
directory.
- Add a Bus: Select the option to add a bus and enter the required details.
- View Buses: Select the option to view all available buses.
- Remove a Bus: Select the option to remove a bus and provide the bus ID.
- Book a Ticket: Select the option to book a ticket and enter the required details.
- View Reservations: Select the option to view all reservations.
- Cancel a Reservation: Select the option to cancel a reservation and provide the reservation ID.
If you would like to contribute to this project, feel free to fork the repository, make your changes, and submit a pull request. Please follow the guidelines in the CONTRIBUTING.md file.
This project is licensed under the MIT License - see the LICENSE file for details.
By sponsoring my efforts, you're not merely contributing to the development of my projects; you're investing in its growth and sustainability.
Your support empowers me to dedicate more time and resources to improving the project's features, addressing issues, and ensuring its continued relevance in the rapidly evolving landscape of technology.
Your sponsorship directly fuels innovation, fosters a vibrant community, and helps maintain the project's high standards of quality. Together, we can shape the future of the projects and make a lasting impact in the open-source community.
Thank you for considering sponsoring my work!