Welcome to the Bus Reservation System repository! This is a console-based application written in C, designed to manage bus ticket bookings, cancellations, and seat status inquiries. The system includes a secure login feature to ensure only authorized users can access the functionalities.
- Secure Login: Protects the system from unauthorized access.
- View Bus List: Displays the list of available buses.
- Book Tickets: Allows users to book tickets for a selected bus.
- Cancel Booking: Enables users to cancel an existing booking.
- Bus Status Board: Shows the current status of seats for a selected bus.
main.c
: The main source code file containing all the functions for the system.tr1.txt
,tr2.txt
,tr3.txt
,tr4.txt
,tr5.txt
: Files to store seat availability for each bus.status1.txt
,status2.txt
,status3.txt
,status4.txt
,status5.txt
: Files to store passenger names for each bus.number1.txt
,number2.txt
,number3.txt
,number4.txt
,number5.txt
: Files to store seat numbers for each bus.
- A C compiler (e.g., GCC)
- A terminal or command prompt
-
Clone the Repository:
git clone https://github.com/xenon0906/Bus-Station.git cd bus-reservation-system
-
Compile the Program:
gcc main.c -o bus-station
-
Run the Program:
./bus-station
-
Login:
- Enter the username:
sid
- Enter the password:
123
- Enter the username:
-
Navigate the Menu:
- View Bus List: Lists all available buses.
- Book Tickets: Prompts to select a bus and the number of tickets, then records passenger details.
- Cancel Booking: Prompts to enter bus and seat number to cancel the booking.
- Bus Status Board: Displays the current status of seats for a selected bus.
Manages user authentication.
Displays the list of available buses.
Handles the booking process for bus tickets.
Records passenger names and seat numbers.
Reads seat numbers from the file for the specified bus.
Reads passenger names from the file for the specified bus.
Displays the current status of seats for a selected bus.
Displays seat status during the booking process.
Handles ticket cancellation and updates records accordingly.
- Ensure the text files (
tr1.txt
,tr2.txt
, etc.) exist in the same directory as the executable and have the correct initial values. - The program uses
system("cls")
andgetch()
functions, which are specific to Windows. For cross-platform compatibility, these might need modification.
Contributions are welcome! If you have suggestions or improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Enjoy using the Bus Reservation System! If you have any questions or encounter any issues, feel free to open an issue or contact me directly.
Author: Siddhanth