0% found this document useful (0 votes)
12 views

bus reservation system

Uploaded by

nice40025291
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

bus reservation system

Uploaded by

nice40025291
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

A

AI Course PBL Report on


BUS RESERVATION SYSTEM
submitted in partial fulfillment of the requirements for the award of the
degree of

BACHELOR OF TECHNOLOGY
IN

COMPUTER SCIENCE AND ENGINEERING - DATA SCIENCE


by

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.

(An Autonomous Institution)

DEPARTMENT OF CSE - DATA SCIENCE

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.

Internal Guide HOD, CSE-DS


R. Rajashekar Dr. B. Srinivasa Rao
Associate Professor Professor

External Examiner
DECLARATION BY THE CANDIDATE

We, K. Harshitha bearing (23R11A67F4), V Durga Prasad bearing (23R11A67J7) , V.

Divya Deepthi bearing (23R11A67J8) and (Name of the student) bearing (HT.NO)

hereby declare that the project report entitled “BUS RESERVATION SYSTEM” is done

under the guidance of Dr. / Mr. R. Rajashekar, Associate Professor, Department of

Computer Science and Engineering – Data Science, Geethanjali College of Engineering

and Technology (GCET), Cheeryal, Hyderabad is submitted in partial fulfillment of the

requirements for the award of the degree of Bachelor of Technology in Computer

Science and Engineering-Data Science.

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

award of any other degree or diploma.

23R11A67F4 – K. Harshitha

23R11A67J7 – V. Durga Prasad


23R11A67J8- V. Divya Deepthi
ACKNOWLEDGEMENTS

First and foremost, we express our sincere thanks for the guidance and

encouragement rendered by Mr. R. Rajashekar, Associate Professor in the Department

of Computer Science & Engineering – Data Science, Geethanjali College of Engineering

& Technology (GCET), Cheeryal, Hyderabad. We extend our gratitude for his advice and

guidance during the progress of this project work.

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.

Our heartfelt thanks for his endorsement and valuable suggestions.

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,

GCET for providing necessary facilities to make this project a success.

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

DBMS - Data Base Management System


UML - Unified Modeling Language
PBL - Project Based Learning
BRS - Bus Reservation System
OOP - Object-Oriented Programming
UI - User Interface
DB - Database
API - Application Programming Interface
CRUD – Create, Read, Update, Delete
GUI – Graphical User Interface
SQL – Structured Query Language
JDBC – Java Database Connectivity
ORM – Object-Relational Mapping
PK – Primary Key
FK – Foreign Key
DBMS – Database Management System
DDL – Data Definition Language
DML - Data Manipulation Language
TABLE OF CONTENTS

I. Introduction 1 -5
II. System Design 6- 9
III. Coding 10-15
IV. Outputs 16
V. Conclusion 17
VI. References 18
INTRODUCTION

In many cities and regions, bus transportation is a primary mode of travel.


However, managing bus reservations manually or through inefficient systems can
lead to errors, overbookings, and user dissatisfaction. Therefore, a reliable and
efficient Bus Reservation System is needed to streamline the process of booking,
managing, and tracking reservations for bus services.
The goal of this system is to provide a user-friendly, automated solution that allows
passengers to view available buses, reserve seats, cancel reservations, and track
the status of bus routes in real-time. The system should be designed using Object-
Oriented Programming (OOP) principles to ensure scalability, maintainability, and
ease of use.
Key Functional Requirements:
1. Bus Management:
o The system must allow the addition of multiple buses with details such as
bus number, route, total seats, and reserved seats.
o Display the list of buses with their respective details, including available and
reserved seats.
2. Reservation System:
o Users should be able to reserve a seat on a bus, provided there are
available seats.
o The system should prevent overbooking and ensure that a user cannot
reserve more seats than are available.
o A passenger should be able to cancel a reservation on a bus if needed.
3. Seat Availability:
o The system should allow users to check the current availability of seats on
a particular bus.
o After a reservation is made, the system should update the bus's available
seat count.
4. User Interaction:
o The system should provide a simple and intuitive interface for passengers

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;

Processor : Intel Pentium IV 2.4 GHZ or above

Clock speed : 500 MHZ

System bus : 32 bits

RAM : 256MB of RAM

HDD : 40 GB or higher

Monitor : SVGA COLOR

Keyboard : 108 keys

Mouse : 2 button mouse

Software Specification:

OS : MS WINDOWS XP SP2

Front End : .NET

Back End : MS ACCESS 2003

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;
}

// Getters and Setters


public String getBusNumber() {
return busNumber;
}

public void setBusNumber(String busNumber) {


this.busNumber = busNumber;
}

public String getRoute() {


return route;
}

10.
public void setRoute(String route) {
this.route = route;

public int getTotalSeats() {


return totalSeats;
}

public void setTotalSeats(int totalSeats) {


this.totalSeats = totalSeats;
}

public int getReservedSeats() {


return reservedSeats;
}

public void setReservedSeats(int reservedSeats) {


this.reservedSeats = reservedSeats;
}

// Method to check if there are available seats


public boolean isAvailable() {
return reservedSeats < totalSeats;
}

// Method to reserve a seat


public boolean reserveSeat() {
if (isAvailable()) {
reservedSeats++;

11.
return true;
} else {
return false;
}
}

// Method to cancel a reservation


public boolean cancelSeat() {
if (reservedSeats > 0) {
reservedSeats--;
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;

// Constructor to initialize the buses array


public ReservationSystem(int maxBuses) {
buses = new Bus[maxBuses];
busCount = 0;
}

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.");
}
}

// Method to display all buses


public void displayBuses() {
System.out.println("Bus Number Route Total Seats Reserved
Seats");
System.out.println("------------------------------------------------------------");
for (int i = 0; i < busCount; i++) {
System.out.println(buses[i]);
}
}

// Method to reserve a seat on a bus


public boolean reserveSeat(String busNumber) {
for (int i = 0; i < busCount; i++) {
if (buses[i].getBusNumber().equals(busNumber)) {
return buses[i].reserveSeat();
}
}
return false; // Bus not found
}

// Method to cancel a reservation


public boolean cancelReservation(String busNumber) {
for (int i = 0; i < busCount; i++) {
13.
if (buses[i].getBusNumber().equals(busNumber)) {
return buses[i].cancelSeat();
}
}
return false; // Bus not found
}
}

public class BusReservationApp {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
ReservationSystem reservationSystem = new ReservationSystem(5); //
Maximum 5 buses

// Add some buses to the system


reservationSystem.addBus("B1", "City A to City B", 50);
reservationSystem.addBus("B2", "City C to City D", 40);
reservationSystem.addBus("B3", "City E to City F", 60);

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.

You might also like