bus reservation system
bus reservation system
BACHELOR OF TECHNOLOGY
IN
23R11A67F4- K. Harshitha
23R11A67J7-V. Durga Prasad
23R11A67J8- V. Divya Deepthi
Under the esteemed guidance of
Mr.R. Rajashekar
Associate Professor
Department of
Computer Science & Engineering –Data Science
GEETHANJALI COLLEGE OF ENGINEERING & TECHNOLOGY (GCET)
Appoved by AICTE, New Delhi, Affiliated to JNTUH University, Hyderabad and Accredited by NAAC & NBA.
Cheeryal(V), Keesara(M), Medchal(Dist.), Telangana – 501 301.
(An Autonomous Institution)
December, 2024
GEETHANJALI COLLEGE OF ENGINEERING & TECHNOLOGY (GCET)
Appoved by AICTE, New Delhi, Affiliated to JNTUH University, Hyderabad and Accredited by NAAC & NBA.
Cheeryal(V), Keesara(M), Medchal(Dist.), Telangana – 501 301.
CERTIFICATE
This is to certify that the B. Tech PBL Project report entitled “BUS RESERVATION
SYSTEM” is a bonafide work done by K. Harshitha bearing (23R11A67F4), V.
Durga Prasad bearing (23R11A67J7), V. Divya Deepthi bearing (23R11A67J8) in
partial fulfillment of the requirements for the award of the degree of Bachelor of
Technology in Computer Science and Engineering – Data Science from
Jawaharlal Nehru Technological University, Hyderabad during the year 2024-2025.
External Examiner
DECLARATION BY THE CANDIDATE
Divya Deepthi bearing (23R11A67J8) and (Name of the student) bearing (HT.NO)
hereby declare that the project report entitled “BUS RESERVATION SYSTEM” is done
This is a record of bonafide work carried out by us and the results embodied in this
project have not been reproduced or copied from any source. The results embodied in
this project report have not been submitted to any other University or Institute for the
23R11A67F4 – K. Harshitha
First and foremost, we express our sincere thanks for the guidance and
& Technology (GCET), Cheeryal, Hyderabad. We extend our gratitude for his advice and
Secondly, We express our sincere thanks to Dr. B. Srinivasa Rao, Professor &
Head, Department of CSE-DS, GCET who stood as silent inspiration behind this project.
We wish to express our profound thanks to Dr. V. Madhusudan Rao, Professor &
Dean, School of CS & I for motivating and guiding us during this project work.
We wish to express our heartfelt thanks to Dr. Udaya Kumar Susarla, Principal,
We thank all the members of teaching and non-teaching staff members, and also
who have assisted us directly or indirectly for successful completion of this project.
Finally, We would like to express our sincere gratitude to our parents who are
constantly encouraging us through-out our lives and for completion of this project.
23R11A67F4 – K. Harshitha
23R11A67J7 – V. Durga Prasad
23R11A67J8- V. Divya Deepthi
ABSTRACT
An Online Bus Reservation System is a mobile application that facilitates travel and online
ticket purchase. A reservation system is an application that is utilized in a bus
transportation system for reservation of seats, cancelling a seat reservation and querying
client and bus information, as well as previous reservations. about several types of routes
for an immediate reservation. This software is designed for an online ticketing system
that uses data from its database, ticket booking and bus tracking, and obtaining the best
price for clients based on their ratings. Travellers are a large growing business across all
countries. Bus reservation system deals with the maintainance of records of details of
each bus. We observed the working of the bus reservation system and after going through
it, we got to know that there are many operations, which they have to do manually. It
takes a lot of time and causing many errors while data entry. Due to this, sometimes a lot
of problems occur and they were facing many problems with the costumers. To solve the
above problem, and further maintaining records of passenger details, seat number etc..,
by this software we can book tickets very easily and we can know easily that how many
seats are still available.
LIST OF FIGURES / DIAGRAMS / GRAPHS
Diagrams:
➢ Context diagram
➢ DFD Administrator
Modules:
➢ Management of Route
➢ Trip Details
➢ Bus Details
➢ Bus Stops
➢ Bus Ticketing
LIST OF TABLES
1. Login
2. Route management
3. Bus details
4. Bus stop
5. Trip
6. Ticketing
LIST OF ABBRIVIATIONS
I. Introduction 1 -5
II. System Design 6- 9
III. Coding 10-15
IV. Outputs 16
V. Conclusion 17
VI. References 18
INTRODUCTION
1.
to interact with, either via a text-based or graphical interface.
o The system should handle various user inputs, including seat reservations,
cancellations, and viewing bus details.
5. Error Handling:
o The system should handle invalid inputs and prevent actions like
overbooking, invalid bus numbers, or canceling non-existent reservations.
6. Data Persistence (Optional for Future Enhancements):
o The system should be able to save the reservation data to a file or
database, so the data can be retrieved and updated across different
sessions.
Existing System:
Existing system refers to the system that is being followed till now. The existing system
requires more computational time, more manual calculations, and the complexity involved
in Selection of features is high. The other disadvantages are lack of security of data,
Deficiency of Data accuracy, Time consuming etc. To avoid all these limitations and make
the working more accurately the system needs to be computerized. Here in the electronic
bus ticketing, a detailed study of existing system is carried along with all the steps in
system analysis.
Proposed System:
The aim of proposed system is to develop a system of improved facilities. The Proposed
system can overcome all the limitations of the existing system. The system provides
proper security and reduces the manual work. The existing system has several
disadvantages and many more difficulties to work well. The proposed system tries to
eliminate or reduce these difficulties up to some extent. The proposed system will help
the user to reduce the work load and mental conflict. The proposed system helps the user
to work user friendly and he can easily do his jobs without time lagging.
2.
Modules details:
1. Management of Route:
This model include information about how we can Manage the routes for a
particular bus services so In the case of Route management module we must
know the details about route number, number of stops, fare stages and running
time of the particular bus more over we want to manipulate and stored these
information successfully.
2. Trip information:
Each journey is identified as a trip. Each ticket must contain the trip no so that
calculation of passenger can be done easily. Here in this section we want to know
start time and route number of the bus this information can be manipulate and
stored successfully.
3. Bus Detail:
In this module all bus details are stored and manipulated, in bus detail module
contains minimum charge, type, depot, fare increment, bus number, and
passenger’s states (child or adult) are manipulate and stored.
4. Bus Stops:
Bus stops module includes information about what are the main bus stops of a
particular bus. This module connected to the route of the bus and it is used to store
stop number, stop name and fare stages and Route number.
5. Bus Ticketing:
Ticketing is the most important module in this Project which uses all the tables
3.
together and calculates fare for the passengers. Venting the tickets is done using
the route number, bus type, beginning stop, end stop, ticket number,
persons(Adult/child)rate, date and time also we want to print the all these
information. In order to do the calculation data has to be pulled out from stops,
bus, trip and route. Number of passengers & the states are entered by the Venter
and to produce the tickets.
4.
SYSTEM SPECIFICATIONS
Hardware Specifications;
HDD : 40 GB or higher
Software Specification:
OS : MS WINDOWS XP SP2
5.
SYSTEM DESIGN
DATA FLOW DIAGRAM
6.
DATABASE TABLE DESIGN
7.
8.
9.
CODING
import java.util.Scanner;
class Bus {
private String busNumber;
private String route;
private int totalSeats;
private int reservedSeats;
// Constructor
public Bus(String busNumber, String route, int totalSeats) {
this.busNumber = busNumber;
this.route = route;
this.totalSeats = totalSeats;
this.reservedSeats = 0;
}
10.
public void setRoute(String route) {
this.route = route;
11.
return true;
} else {
return false;
}
}
@Override
public String toString() {
return String.format("%-10s %-20s %-10d %-10d", busNumber, route,
totalSeats, reservedSeats);
}
}
class ReservationSystem {
private Bus[] buses;
private int busCount;
12.
// Method to add a bus to the system
public void addBus(String busNumber, String route, int totalSeats) {
if (busCount < buses.length) {
buses[busCount] = new Bus(busNumber, route, totalSeats);
busCount++;
} else {
System.out.println("Bus limit reached. Cannot add more buses.");
}
}
while (true) {
System.out.println("\nWelcome to the Bus Reservation System");
System.out.println("1. Display all buses");
System.out.println("2. Reserve a seat");
System.out.println("3. Cancel a reservation");
System.out.println("4. Exit");
System.out.print("Choose an option: ");
int choice = scanner.nextInt();
scanner.nextLine(); // Consume newline
switch (choice) {
case 1:
reservationSystem.displayBuses();
break;
14.
case 2:
System.out.print("Enter bus number to reserve a seat: ");
String busNumberToReserve = scanner.nextLine();
if (reservationSystem.reserveSeat(busNumberToReserve)) {
System.out.println("Seat reserved successfully.");
} else {
System.out.println("No available seats or invalid bus number.");
}
break;
case 3:
System.out.print("Enter bus number to cancel a reservation: ");
String busNumberToCancel = scanner.nextLine();
if (reservationSystem.cancelReservation(busNumberToCancel)) {
System.out.println("Reservation cancelled successfully.");
} else {
System.out.println("No reservations found or invalid bus number.");
}
break;
case 4:
System.out.println("Exiting system...");
scanner.close();
return;
default:
System.out.println("Invalid choice. Please try again.");
}
}
}
}
15.
OUTPUT
16.
CONCLUSION
In conclusion, the bus reservation system implemented using Object-Oriented
Programming (OOP) in Java effectively demonstrates how key OOP principles like
encapsulation, modularity, and abstraction can be applied to create a functional and
organized solution. By organizing the system into distinct classes such as Bus,
ReservationSystem, and BusReservationApp, each responsible for specific tasks, the
code remains clean, maintainable, and easily extendable. Encapsulation ensures that
internal data, such as the number of seats and reserved seats, is protected, while
providing controlled access through getters and setters. The system allows users to view
bus details, reserve seats, and cancel reservations via a simple text-based interface,
making it user-friendly and interactive. The modular design also ensures that the system
can be easily extended with additional features, such as persistent storage for data or a
graphical user interface (GUI), to improve user experience and scalability. Overall, this
system serves as a solid foundation for building more complex reservation systems,
demonstrating the power and flexibility of OOP concepts in real-world applications.
17.
REFERENCES
Online Reference
www.w3schools.com
www.theserverside.com
www.visual.com
18.