Bus Reservation System Using C++
Bus Reservation System Using C++
ON
DATASTRUCTUE AND ALGORITHMS LAB DCS16
BUS RESERVATION
SYSTEM
BY
BINCY S BIJU(811201108)
ATHIRA BABU(811201107)
BINCY S BIJU
ATHIRA BABU
SCHOOL OF DISTANCE EDUCATION
UNIVERSITY OF KERALA
KARIYAVATTOM
CERTIFICATE
This is to certify that the project report entitled “ BUS RESERVATION SYSTEM”
submitted to School of Distance Education, University of Kerala in partial fulfillment of the
requirement for the award of the Degree of MASTER OF COMPUTER SCIENCE, is an
authentic and original work carried out by BINCY S BIJU (811201108) and ATHIRA
BABU(811201107).
External Examiner1
Lecturer in charge
External Examiner2
ACKNOWLEDGEMENT
We gratefully acknowledge the support and kind hearted cooperation by (Coordinator Name)
Coordinator of M.Sc.Computer Science department.
We extend our heartfelt thanks to our classmates, friends and well wishers who helped us to
make this case study success. Above all we are thankful to God, almighty for the strength and
presence of mind to complete these studies work successfully, we humbly solicit and
almighty’s blessings. Our sincere thanks and apologies to anyone who deserve the credit but
whose names fail to appear in the list above.
BINCY S BIJU
ATHIRA BABU
ABSTRACT
Bus reservation system is a very simple application showing the implementation of class along
with the object of C++ language. Here bus seat reservation using linked list and queue. This
application is very simple to understand, and it will help you learn how to create class and object
in your C++ application. Here, the user can perform tasks like install bus information, reserve
bus seat, show reservation information and show information regarding the buses available.
CONTENTS
1. INTRODUCTION
2. SYSTEM STUDY
2.1 EXISTING SYSTEM
2.2 PROPOSED SYSTEM
3. SYSTEM REQUIREMENTS
3.1 HARDWARE REQUIREMENTS
3.2 SOFTWARE REQUIREMENTS
4. SYSTEM ANALYSIS
4.1 FEASIBILITY STUDY
4.2 TECHNICAL FEASIBILITY
4.3 ECONOMICAL FEASIBILTY
4.4 SOCIAL FEASIBILITY
4.5 BEHAVIOURAL FEASIBILITY
4.6 ABOUT THE PROJECT
5. SYSTEM DESIGN
5.1 MODULE DESCRIPTION
5.2 INPUT DESIGN
5.3 OUTPUT DESIGN
5.4 DATA FLOW DIAGRAM (DFD)
6. IMPLEMENTATION AND SYSTEM TESTING
6.1 IMPLEMENTATION
6.2 SYSTEM TESTING
7. SOURCE CODE
8. OUTPUT SCREENSHOTS
9. CONCLUSION
10. BIBLIOGRAPHY
1. INTRODUCTION
Simple Bus Reservation System is based on the concept of reserving bus seats for the
passengers. There’s no login system available for this system, the user can freely use its
feature. This mini project contains limited features, but the essential one. Make sure that you
install the code editor for C programming to run the project. Talking about the features of this
Simple system, the user can view bus list, book tickets, modify bus record and check bus
status board. While booking tickets, the user has to enter bus number then the system displays
total bus seat numbers with passengers name and the user has to enter the number of tickets,
seat number, and name of the person.
Functions
a) Add buses.
b) Show selected bus
c) Display list in booked tickets.
d) Delete buses.
e) Book bus tickets.
f) Display booked tickets.
Objectives
The main objective of this case study is to study C++ Linked list application and also
how to deal with that. By using this, we can add and delete club member’s information,
understand the club information in a linked list and how it will be processed.
SYSTEM STUDY
2. SYSTEM STUDY
2.1 Existing System
Existing system is file system method is a type of data storing method where we can save
the data. Most of the operations in the existing system of this project is to do basic operations.
Drawbacks of existing system :
• When we use the file system, data can be lost.
• Not efficient
• Difficult to manage the file system
6.1 Implementation
Implementation is the process of putting an action for the
formulated plan. Before we implement, the plan should have been completed and our
objectives should be clear. Testing each one of those actions formulated in the plan is
said to be implementation testing.
Here we are using C++ language to implement this tool. Also included header files
iostream, conio and process.
#include<iostream>
#include<fstream>
#include<conio.h>
#include<string.h>
class Bus
{ int bid;
char destination[200];
char time[50];
int max_seats;
int booked;
int fare;
public:
Bus()
{
bid=0;
max_seats=10;
booked=0;
fare=0;
strcpy(time,"9:10am");
strcpy(destination,"");
void input();
void show();
void display();
int getid()
return bid;
void book()
booked++;
char* getDestination()
return destination;
}
char* getTime()
return time;
int getBooked(){
return booked;
int getMax(){
return max_seats;
int getFare()
return fare;
};
class Ticket
char name[50];
Bus bus;
public:
strcpy(name,cname);
bus=tb;
void display()
bus.show();
};
void Bus::input()
cin>>bid;
cin>>destination;
cin>>time;
cin>>fare;
}
void Bus::display()
cout<<bid<<"\t"<<destination<<"\t\t"<<time<<"\t"<<max_seats<<"\t"<<booked<<"\
t"<<fare<<"\n";
void Bus::show()
cout<<"Bus Id "<<bid<<endl;
cout<<"Desination "<<destination<<endl;
cout<<"Time "<<time<<endl;
int main()
int ch;
fstream F,G;
Bus b;
do
cin>>ch;
switch(ch)
case 1:
F.open("tour.dat",ios::app | ios::binary);
b.input();
F.write((char*)&b, sizeof(b));
F.close();
getch();
break;
case 2:
int id,chk=0;
cin>>id;
F.open("tour.dat",ios::in | ios::binary);
if(F.fail())
else
while(F.read((char*)&b,sizeof(b)))
if(b.getid()==id)
b.show();
chk=1;
break;
if(chk==0)
F.close();
break;
case 3:
{
F.open("tour.dat",ios::in | ios::binary);
if(F.fail())
else
while(F.read((char*)&b,sizeof(b)))
b.display();
F.close();
getch();
break;}
case 4:
int chk=0,id;
cin>>id;
F.open("tour.dat",ios::in | ios::binary);
G.open("temp.dat",ios::out | ios::binary);
if(F.fail())
while(F.read((char*)&b,sizeof(b)))
if(b.getid()!=id)
G.write((char*)&b,sizeof(b));
else
b.show();
chk=1;
if(chk==0)
else
F.close();
G.close();
remove("tour.dat");
rename("temp.dat","tour.dat");
break;}
case 5:
char dest[70],cname[50];
int bid;
Ticket t;
cin>>dest;
if(F.fail())
else
while(F.read((char*)&b,sizeof(b)))
if(strcmp(b.getDestination(),dest)==0)
b.show();
b.book();
t.generate(cname,b);
G.open("tickets.dat",ios::app | ios::binary);
G.write((char*)&t,sizeof(t));
G.close();
// F.seekp(F.tellg()-sizeof(b),ios::beg);
F.write((char*)&b,sizeof(b));
cout<<"Ticket booked"<<endl;
getch();
break;}
int chk;
if(chk==0)
F.close();
break;}
case 6:
Ticket t;
G.open("tickets.dat",ios::in | ios::binary);
if(G.fail())
else
while(G.read((char*)&t,sizeof(t)))
t.display();
G.close();
getch();}
}
}
while(ch!=7);
return 0;
}
SCREENSHOTS
CONCLUSION
9. CONCLUSION
This software tool named “BUS RESERVATION SYSTEM” helps to
manage reservaed information in linked list. We have given the option add the details of
buses, view the details, the user can perform tasks like install bus information, reserve
bus seat, show reservation information and show information regarding the buses
available. We can improve efficiency of the system, Less human error, Strength and
Strain of manual labour can be reduced, High Security, Data Consistency, Easy to handle,
Easy data updating, Easy record keeping.
REFERENCE
10. REFERENCE