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

java.report3 (2)

Java project

Uploaded by

rai.2003.anjali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

java.report3 (2)

Java project

Uploaded by

rai.2003.anjali
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

CERTIFICATE

This is to certify that the minor project dissertation entitled “BUS RESERVATION AND
TICKETING SYSTEM” using Java , being submitted by Anjali Rai (21BTCSE006) and
Varsha Tiwari(21BTCSE043). The project work has been carried out for the partial
fulfillment of the requirements of BACHELOR OF TECHNOLOGY in COMPUTER
SCIENCE AND ENGINEERING.
DECLARATION

I/We, hereby declare that the minor project dissertation work entitled “BUS
RESERVATION AND TICKETING SYSTEM” using Java which is being submitted to
the Department of Computer Science and Engineering at GANGA INSTITUTE OF
TECHNOLOGY and MANAGEMENT a bonafide work carried out by me.
This work has not been submitted, in part or full, to any other University or Institute for
the award of any other degree or diploma.

ANJALI RAI VARSHA TIWARI


(21BTCSE006) (21BTCSE043)
ACKNOWLEDGEMENT

We would like to extend our deepest gratitude to everyone who contributed to the success
of this project. This journey has been one of collaboration ,learning, and mutual support
culminating in a project that we are proud to present.

First and foremost we express our sincere thanks to our project supervisor whose
guidance , expertise, and patience were instrumental in steering this project towards its
completion .
We are deeply greateful to our college(GITAM) and its faculty and staff for providing
us with the resources and environment conductive to our research and development
efforts. Their assistance in navigation academic and logistical challenges was crucial

Lastly , we extend our gratitude to each other ,the members of study notation app. This
project was a collaborative effort that required dedication and compromise.

ANJALI RAI VARSHA TIWARI


(21BTCSE006) (21BTCSE043)
ABSTRACT

The bus transportation industry is evolving rapidly, and the need for an efficient, secure,
and convenient ticketing system has become more crucial than ever. A bus reservation
and ticketing system is an innovative software application that enables customers to book
bus tickets online or through a mobile application. The system simplifies the ticketing
process, reduces waiting times, and improves the overall customer experience.

Overall, a bus reservation and ticketing system is an essential tool for any modern
transportation company that wants to stay ahead of the competition and provide a
seamless customer experience. The system has revolutionized the way bus transportation
companies manage their operations and provide their services, making it an indispensable
technology for the industry.
CONTENTS
Certificate

Candidate’s Declaration ii

Acknowledgements iii

Abstract v

Contents vii

1. Introduction 1

2. System Analysis 2-4

2.1 Existing system 2

2.2 Proposed system 2

2.3 System requirements 3

3. Methodology 5-7

3.1 System architecture 5


5
3.2 Algorithm description
6-7
3.3 Modular design
8-18
4. Implementation
19-21
5. Output
22
6. Conclusion
23
7. Biblography
1. INTRODUCTION

A bus reservation and ticketing system is a software application that enables customers to
book bus online or through a mobile application. The system is designed to simplify the
ticketing process, reduce waiting times, and improve the overall customer experience. With
a bus reservation and ticketing system, customers can search for bus routes, schedules, and
availability, select their preferred seats, and make payments securely online. The system
provides real-time information on bus availability, schedules, and pricing, enabling
customers to make informed decisions quickly and easily. Bus operators can use the system
to manage their schedules and routes, allocate seats, and monitor ticket sales and revenue.
They can also generate reports on key metrics such as sales, revenue, and customer
feedback, enabling them to optimize their operations and improve the customer experience.
The benefits of a bus reservation and ticketing system are numerous. It can reduce costs
associated with traditional ticketing methods, improve customer satisfaction, and increase
revenue through online sales. With the rise of mobile technology, more and more customers
are looking for convenient and secure ways to book bus tickets online, making a bus
reservation and ticketing system an essential tool for any modern transportation company.
2.SYSTEM ANALYSIS
2.1 Existing System
Before the advent of online booking systems, the bus reservation and ticketing system
relied on traditional methods, such as over-the-counter ticket sales or phone reservations.
These methods were time-consuming, inconvenient, and often resulted in long queues and
waiting times for customers.

They offer several advantages over traditional methods, including:

1. Convenience: Customers can book tickets from the comfort of their homes or offices,
without the need to visit a physical ticket counter.

2. Real-time information: Online booking systems provide customers with real-time


information on bus availability, schedules, and pricing, enabling them to make informed
decisions quickly and easily.

3. Security: Online payment gateways provide secure and reliable payment options,
reducing the risk of fraud and ensuring customer confidence.

4. Accessibility: Online booking systems are accessible 24/7, allowing customers to book
tickets at any time of the day or night.

2.2 Proposed System


A proposed bus reservation and ticketing system would aim to enhance the existing system
by introducing new features and functionalities that further streamline the ticketing process
and improve the customer experience. Some of the proposed features and functionalities of
a bus reservation and ticketing system could include:

1. Mobile application: A mobile application would allow customers to book and


manage their bus tickets on the go, from their smartphones. The mobile app could
provide features such as real-time notifications, GPS tracking, and user-friendly
interfaces.
2. Customizable booking options: Customers could have the option to customize
their bookings by selecting preferred pick-up and drop-off locations, choosing their
preferred bus type, and selecting their preferred seats.
3. Virtual assistant: A virtual assistant could be introduced to provide customers
with personalized recommendations and support, such as suggesting nearby hotels
or restaurants.
4. Dynamic pricing: The system could use dynamic pricing algorithms to adjust
ticket prices based on factors such as demand, time of day, and seat availability,
enabling bus operators to optimize revenue and occupancy rates.
5. Loyalty programs: A loyalty program could be introduced to incentivize
customers to book tickets through the system, offering discounts, rewards, or other
perks for frequent users.

By incorporating the latest technologies and industry best practices, the proposed
system would help bus operators to stay ahead of the competition and provide a
seamless, efficient, and convenient ticketing experience for their customers.

2.3 System Requirements

2.3.1 Hardware Requirements

1.Servers

2.Network infrastructure

3.Workstations

4.Mobile devices

5.POS terminals(point-of-sale)

2.3.2 Software Requirements

1.Web development tools

2.Database management system

3.payment gateway

4.Operating system

5.Mobile Development tools

6.Analytics tools

It is essential to ensure that the software components are reliable, secure, and
scalable to ensure the system's smooth and uninterrupted operation.
3.METHODOLOGY

3.1 System Architecture

Fig.1

3.2 Algorithm description


The algorithm used in a bus reservation and ticketing system typically involves several
steps to ensure that the booking process is efficient, accurate, and user-friendly.

Here is an example of a typical algorithm used in a bus reservation and ticketing system:
1. Bus Schedule Management: The system should have a database of all available bus
schedules, which can be accessed by customers through the web or mobile application.

2.Seat Selection: The system should allow customers to select seats on the bus through an
interactive seat map. The system should also prevent double booking of seats and ensure
that the selected seats are available.

3. Customer Registration: The system should require customers to register on the system
to make a booking. Customer registration should involve capturing customer details such
as name, email address, phone number, and payment information.
4. Payment Processing: The system should allow customers to make online payments
using debit/credit cards or mobile wallets. The payment processing should be secure and
compliant with industry standards and regulations.

5. Ticket Generation: Once the booking is confirmed and the payment is processed, the
system should generate a digital ticket or receipt, which can be accessed by the customer
through the web or mobile application. The system should also allow customers to print the
ticket or receipt.

6. Boarding Validation: The system should validate the ticket or receipt at the time of
boarding using a scanner or QR code reader. The system should also ensure that the
customer has a valid ticket or receipt before allowing them to board the bus .

The algorithm used in a bus reservation and ticketing system should be designed to ensure
a seamless and user-friendly booking process while minimizing errors and conflicts. The
algorithm should also be flexible enough to accommodate future changes and updates to
the system's functionality and features.

3.3 Modular design


Modular design is a popular approach for software development as it allows for easier
maintenance, scalability, and flexibility. When designing a bus reservation and ticketing
system, a modular design can help to create a more efficient and streamlined system

Here are some possible modules that could be included in the system:

1. User Management: This module handles user registration, authentication, and


authorization. It can include features such as password management, account verification,
and user roles.

2. Bus Management: This module manages the buses available for reservation, including
their routes, schedules, and seating plans. It can include features such as adding, editing,
and deleting buses, setting their capacity, and managing their availability.

3. Reservation Management: This module handles the reservation of seats on the buses.
It can include features such as seat selection, payment processing, and confirmation emails.

4. Ticketing Management: This module manages the creation and printing of tickets. It
can include features such as ticket design, barcode generation, and ticket tracking.
5. Reporting Management: This module generates reports on system usage, including

user activity, bus utilization, and revenue generation. It can include features such

as customizable report templates and data visualization tools.

Each of these modules can be designed and implemented independently, allowing for easier
testing, maintenance, and updates. Additionally, modular design allows for the addition or
removal of modules without affecting the entire system, providing greater flexibility for
future changes.
4.IMPLEMENTATION
Code:
import java.io.*;
class BusReservationAndTicketingSystem {
public static void main(String args[]) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String user,password,yn,search,again,choice;
int to=0,y=1,z=0,end=0,r=1;
int available[] = new int[6];
int ticketI[][] = new int [100][3];
String ticketS[][] = new String[100][3];
double ticketD[][] = new double [100][3];
double pay[] = new double[20];
double change[] = new double[20];
for(int i=1;i<4;){
System.out.print("Enter Username: ");
user = in.readLine();
System.out.print("Enter Password: ");
password = in.readLine();
for(int o=1; o<=5; o++){
available[o]=20;
//
}
if(user.equals("varsha_123") && password.equals("anjali_123")){
for(int x=1; x==1;){
//the MAIN MENU//
System.out.println("****************************");
System.out.println("** BUS TICKETING SYSTEM **");
System.out.println("****************************");
System.out.println("** [1] Destination **");
System.out.println("** [2] Buy Ticket **");
System.out.println("** [3] Transaction **");
System.out.println("** [4] View **");
System.out.println("** [5] Exit **");
System.out.println("****************************");
System.out.println("****************************\n");
for(x=1; x==1;){
System.out.print("ENTER CHOICE: ");
choice=in.readLine();
if (choice.equals("1")){
System.out.println("***************************************");
System.out.println("** DESTINATION | FARE| SEAT **");
//
System.out.println("***************************************");
System.out.println("** 1.)Uttam Nagar | Rs12| "+available[1]+" **");
System.out.println("** 2.)Rajouri Garden | Rs15 |"+available[2]+" **");
System.out.println("** 3.)Kirti Nagar | Rs12 |"+available[3]+" **");
System.out.println("** 4.)Rajiv Chowk | Rs16 |"+available[4]+" **");
System.out.println("** 5.)Akshardham | Rs18 |"+available[5]+" **");
System.out.println("***************************************");
System.out.println("***************************************\n");
System.out.println("PWD, STUDENT, & SENIOR CITIZEN with 20%
DISCOUNT!!!\n");
x=0;
}
else if (choice.equals("2")){
int print=1;
System.out.println("***************************************");
System.out.println("** DESTINATION | FARE| SEAT **");
//
System.out.println("***************************************");
System.out.println("** 1.)Uttam Nagar | Rs12 |"+available[1]+" **");
System.out.println("** 2.)Rajouri Garden | Rs15 |"+available[2]+" **");
System.out.println("** 3.)Kirti Nagar | Rs12 |"+available[3]+" **");
System.out.println("** 4.)Rajiv Chowk | Rs16 |"+available[4]+" **");
System.out.println("** 5.)Akshardham | Rs18 |"+available[5]+" **");
System.out.println("***************************************");
System.out.println("***************************************\n");
System.out.println("PWD, STUDENT, & SENIOR CITIZEN with 20%
DISCOUNT!!!\n");
if((available[1]==0)&&(available[2]==0)&&(available[3]==0)&&(available[4]==0)&&(
available[5]==0)){
System.out.println("Sorry, We don't have available seats for all Destination!");
x=0;
}
else{
for(x=1; x==1;){
//
System.out.print("\nENTER PASSENGER'S NAME: ");
ticketS[z][0] = in.readLine();
x=0;
for(int l=0; l<z; l++){
if(ticketS[l]
[0].equalsIgnoreCase(ticketS[z][0])){
System.out.println("Sorry,Passenger's name have already used!");
x=1;
}
}
}
for(x=1; x==1;){
System.out.print("ENTER DESTINATION[number]: ");
to = Integer.parseInt(in.readLine());
if(to<1 || to>5){
System.out.println("Invalid Input!");
x=1;
}
for(int d=1; d<=5; d++){
//
if(to==d){
if(available[to]==0){
System.out.println("Sorry, We don't have available seat!");
x=1;
}
x=0;
}
}
}
String dest[] = { " ", "Uttam Nagar", "Rajouri Garden",
"Kirti Nagar", "Rajiv Chowk", "Akshardham"};
double fare[] = { 0,12,15,12,16,18};
//converted integer to string, transfer to storagearray//
ticketS[z][1] = dest[to];
ticketD[z][0] = fare[to];
//inputing for Number of Passenger's//
for(x=1; x==1;){
System.out.print("HOW MANY PASSENGERS ARE YOU?: ");
ticketI[z][0] = Integer.parseInt(in.readLine());
//subtract the available seat by the the number inputed//
for(int p=1; p<=5; p++){
//
if(to==p){
print=1;
available[to] = available[to]-
ticketI[z][0];
if(available[to]<0){
System.out.print("Sorry, We don't have seat available for " +ticketI[z][0] +"person\n");
available[to] =
available[to]+ticketI[z][0];
System.out.print("We only have " +available[to] +" seat available\n");
x=1;
print=0;
}
else{
x=0;
}
}
}
}
for(x=1;x==1;){
System.out.print("HOW MANY PASSENGERS HAVE DISCOUNT?: ");
ticketI[z][1] =
Integer.parseInt(in.readLine());
//
if(ticketI[z][1]>ticketI[z][0]){
System.out.println("Invalid Input!");
System.out.println("No. of Passengers are only " +ticketI[z][0] +"!");
x=1;
}
else{
break;
}
}
if(print==1){
System.out.println("\n***************************************");
System.out.println("** PASSENGER'S DETAILS **");
System.out.println("***************************************");
System.out.println("PASSENGER'S NAME:" + ticketS[z][0]);
System.out.println("PASSENGER'S DESTINATION : " + ticketS[z][1]);
System.out.println("FARE PRICE: Rs" +ticketD[z][0]);
System.out.println("NO. OF PASSENGERS: " + ticketI[z][0]);
//
System.out.println("NO. OF PASSENGERS WITH DISCOUNT: " + ticketI[z][1]);
System.out.println("***************************************");
System.out.println("***************************************\n");
ticketS[z][2]="0";
double discount=(ticketD[z][0]-(ticketD[z]
[0]*0.2))*ticketI[z][1];
ticketD[z][2]= ((ticketI[z][0]-ticketI[z]
[1])*ticketD[z][0])+discount;
x=0;
}
z++;
}
}
else if (choice.equals("3")){
for(x=1; x==1;){
System.out.print("ENTER PASSENGER'S NAME: ");
search = in.readLine();
int s=1;
for(int b=0;b<z;b++){
if(search.equalsIgnoreCase(ticketS[b][0])){
//
System.out.println("***************************************");
System.out.println("** PASSENGER'S DETAILS **");
System.out.println("***************************************");
System.out.println("PASSENGER'S NAME: " + ticketS[b][0]);
System.out.println("PASSENGER'S DESTINATION : " + ticketS[b][1]);
System.out.println("FARE PRICE: Rs" + ticketD[b][0]);
System.out.println("NO. OF PASSENGERS: " + ticketI[b][0]);
System.out.println("NO. OF PASSENGERS WITH DISCOUNT: " + ticketI[b]
[1]);
System.out.println("***************************************");
System.out.println("***************************************");
s=0;
x=0;
if(ticketS[b]
[2].equals("x")){
System.out.println("Passenger's Already Paid!");
x=0;
}
else{
ticketS[b]
[2]="x";
//
for(x=1;
x==1;){
System.out.println("\nPASSENGER'S TOTAL FARE: Rs"+ticketD[b][2]);
System.out.print("ENTER AMOUNT TO PAY: ");
pay[b]
= Double.parseDouble(in.readLine());
change[b]=pay[b]-ticketD[b][2];
if(change[b]<0){
System.out.println("Invalid Input!");
x=1;
}
else{
System.out.println("CHANGE: Rs"+change[b]);
System.out.println("");
x=0;
}
}
}
}
}
//
if (s==1){
System.out.println("\nPASSENGER'S NAME NOT FOUND!\n");
for(int q=1; q==1;){
System.out.print("Do you wish to continue with this transaction? [Y/N]: ");
again=in.readLine();
if(again.equalsIgnoreCase("y")){
q=0;
}
else if
(again.equalsIgnoreCase("n")){
q=0;
x=0;
}
else{
System.out.println("\nInvalid input!\n");
}
}
}
}
}
//
else if (choice.equals("4")){
for(int sx=1; sx<=3;){
System.out.print("SEARCH PASSENGER'S NAME: ");
search = in.readLine();
int s=1;
for(x=0; x<=z; x++){
if(search.equalsIgnoreCase(ticketS[x][0])){
System.out.println("***************************************");
System.out.println("**PASSENGER'S DETAILS **");
System.out.println("***************************************");
System.out.println("PASSENGER'S NAME: " + ticketS[x][0]);
System.out.println("PASSENGER'S DESTINATION : " + ticketS[x][1]);
System.out.println("FARE PRICE: Rs" + ticketD[x][0]);
System.out.println("NO. OF PASSENGERS: " + ticketI[x][0]);
System.out.println("NO. OF PASSENGERS WITH DISCOUNT: " + ticketI[x][1]);
System.out.println("TOTAL FARE PRICE: Rs" + ticketD[x][2]);
if(ticketS[x][2].equals("x")){
//
System.out.println("PAY: Rs" +pay[x]);
System.out.println("CHANGE: Rs" +change[x]);
System.out.println("STATUS: PAID");
}
else{
System.out.println("STATUS: NOT PAID");
}
System.out.println("***************************************");
System.out.println("***************************************");
s=0;
sx=4;
}
}
if (s==1){
System.out.println("Passenger's Name not found!");
sx++;
}
}
}
else if(choice.equals("5")){
//
end=1;
x=0;
System.out.println("Thank You!");
}
else{
System.out.println("Invalid Input!");
x=1;
}
}
for(y=1; y==1;){
if(end==1){
break;
}
System.out.print("Do you want another transaction? [Y/N]:");
yn = in.readLine();
if (yn.equalsIgnoreCase("y")){
x=1;
y=0;
}
else if (yn.equalsIgnoreCase("n")){
System.out.println("\nThank You!!!");
break;
}
else{
System.out.println("Invalid Input!!!");
//
y=1;
}
}
}
i=4;
}
else{
System.out.println("\nInvalid user or password!\n");
i++;
}
}
}
}
5.OUTPUT
6.CONCLUSION

A bus reservation and ticketing system provides many benefits for both bus operators and
passengers. Bus operators can increase their efficiency and revenue, while passengers can
enjoy a more convenient and hassle-free booking experience. The system can also help
reduce fraudulent activities and improve data accuracy, making it a win-win situation for
all parties involved. Overall, the adoption of such systems has been increasing rapidly, and
it is likely to become a standard practice in the bus transportation industry in the coming
years.
7.BIBLOGRAPHY
References:
https://www.sourcecodester.com/bus-reservation-and-ticketing-system-java-
console.html
https://www.oneclickitsolution.com

You might also like