100% found this document useful (3 votes)
2K views

Bus Reservation System Using C++

This document is a case study report for a bus reservation system project submitted by two students, Bincy S Biju and Athira Babu, in partial fulfillment of the requirements for a Master of Computer Science degree from the University of Kerala. The report includes a declaration by the students, a certificate from their guide, an acknowledgement, and an abstract describing the bus reservation system project. The contents section outlines the various parts of the report, including introductions, existing and proposed systems, system requirements, system analysis, system design, implementation and testing, source code, output screenshots, and conclusions.

Uploaded by

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

Bus Reservation System Using C++

This document is a case study report for a bus reservation system project submitted by two students, Bincy S Biju and Athira Babu, in partial fulfillment of the requirements for a Master of Computer Science degree from the University of Kerala. The report includes a declaration by the students, a certificate from their guide, an acknowledgement, and an abstract describing the bus reservation system project. The contents section outlines the various parts of the report, including introductions, existing and proposed systems, system requirements, system analysis, system design, implementation and testing, source code, output screenshots, and conclusions.

Uploaded by

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

CASE STUDY REPORT

ON
DATASTRUCTUE AND ALGORITHMS LAB DCS16

BUS RESERVATION
SYSTEM

BY

BINCY S BIJU(811201108)

ATHIRA BABU(811201107)

Submitted in partial fulfillment of the


Requirements for the award M.Sc (Computer Science) degree of
University of Kerala
2020-2022

SCHOOL OF DISTANCE EDUCATION


UNIVERSITY OF KERALA
KARIYAVATTOM
DECLARATION
I hereby declare that the work presented in the case study titled (topic
name) is an the original work done by us under the guidance of Mrs. (guide Name)
Lecturer of Computer Science department. The same work has not been submitted
elsewhere or any other degree.

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.

(Include your Guide also)

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

2.2 Proposed System


This proposed system help us to manage Bus Reservation Information . Few features of
this system are:
• This software is more efficient and easy to use.
• Easy to manage
• User can easily understand the operations what is happening in background.
• Here we can add , delete and view the member’s information
• More efficient than the existing system
• The current application provides most unique features than the before systems in current
real world market.
SYSTEM REQUIREMENTS
3. SYSTEM REQUIREMENTS
3.1 Hardware Requirements

• Processor : Intel Pentium or any compatible processors


• RAM : 4 GB or above
• Monitor : LCD colour monitor
• Harddisk : 500GB

3.2 Software Requirements

• Operating System: Windows xp/7/8/10


• C++
SYSTEM DESIGN
4. SYSTEM DESIGN
System design is the process of the problem solving and planning for a software solution. A
software design may be as simple as a flowchart or text describing a planned sequence of events.
In other case, some documentation of the plan is usually the product of the design. A software
design may be platform independent or platform specific, depending on the availability of the
technology called for by the design.
Mainly we have 7 modules. They are:
1) Add buses.
2) Show selected bus
3) Display list in booked tickets.
4) Delete buses.
5) Book bus tickets.
6) Display booked tickets.
7) Exit

5.1 Module Description


a) Add buses
Here add new buses.
b) Show selected bus
Here displays the selected bus details.
c) Display list in booked tickets
Here display the whole details of all booked tickets.
d) Delete buses
Here deleted busses.
e) Book bus tickets
Here book a ticket.
5.2 Input Design
The input design is the process of converting the user oriented inputs into the
computer based format. Therefore, the user interface design is very important for any
applications. It defines how the software communicates with in itself to system that
implemented with it and with human who use it. If the interface design is very good, the
user will fall into a software applications.

5.3 Output Design


Computer output is the most important and direct source of information to user
efficient, intelligible output design should improve the system’s relationships with the
user and help in decision making. It provides a means of storage by copying the result for
later reference.

5.4 Data Flow Diagram


A data-flow diagram ( DFD )is a way of representing a flow of a data of a process
or a system. The DFD also provides information about the outputs and inputs of each
entity and the process itself. A data-flow diagram has no control flow, there are no
decision rules and no loops. Specific operations based on the data can be represented by a
flowchart.

Level 0 : Context level diagram

Level 1 : DFD for create member


IMPLEMENTATION AND TESTING

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.

6.2 System Testing


The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. In system testing, we
combined all the modules and had run the project in Turbo C++ /Dev C++ environment.
First of all, we setup a linked list to implement this tool.
SOURCE CODE

#include<iostream>

#include<fstream>

#include<conio.h>

#include<string.h>

using namespace std;

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:

void generate(char cname[], Bus tb)


{

strcpy(name,cname);

bus=tb;

void display()

cout<<"Customer Name "<<name<<"\n";

cout<<"Details of Bus "<<"\n";

bus.show();

};

void Bus::input()

cout<<"Enter bus id ";

cin>>bid;

cout<<"Enter bus destination ";

cin>>destination;

cout<<"Enter time of bus ";

cin>>time;

cout<<"Enter fare of the bus ";

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;

cout<<"No. of seats remaining "<<max_seats-booked<<endl;

int main()

int ch;

fstream F,G;

Bus b;

do

cout<<"Press 1 - Add a Bus"<<endl;

cout<<"Press 2 - Show Selected Bus"<<endl;

cout<<"Press 3 - Display All Buses"<<endl;

cout<<"Press 4 - Delete a Bus"<<endl;


cout<<"Press 5 - Book a ticket "<<endl;

cout<<"Press 6 - Display Booked Tickets "<<endl;

cout<<"Press 7 - Exit "<<endl;

cout<<"Enter your choice ";

cin>>ch;

switch(ch)

case 1:

F.open("tour.dat",ios::app | ios::binary);

b.input();

F.write((char*)&b, sizeof(b));

F.close();

cout<<"Bus added Successfully "<<endl;

getch();

break;

case 2:

int id,chk=0;

cout<<"Enter the bus id to be displayed ";

cin>>id;

F.open("tour.dat",ios::in | ios::binary);
if(F.fail())

cout<<"Can't open file "<<endl;

else

while(F.read((char*)&b,sizeof(b)))

if(b.getid()==id)

b.show();

chk=1;

break;

if(chk==0)

cout<<"Bus not Found"<<endl;

F.close();

break;

case 3:
{

F.open("tour.dat",ios::in | ios::binary);

if(F.fail())

cout<<"Can't open file "<<endl;

else

while(F.read((char*)&b,sizeof(b)))

b.display();

F.close();

cout<<"Press a key to continue ";

getch();

break;}

case 4:

int chk=0,id;

cout<<"Enter the bus id to be deleted ";

cin>>id;

F.open("tour.dat",ios::in | ios::binary);

G.open("temp.dat",ios::out | ios::binary);

if(F.fail())

cout<<"Can't open file "<<endl;


else

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)

cout<<"Bus not Found"<<endl;

else

cout<<"Bus Deleted "<<endl;

F.close();
G.close();

remove("tour.dat");

rename("temp.dat","tour.dat");

break;}

case 5:

char dest[70],cname[50];

int bid;

Ticket t;

cout<<"Enter the destination ";

cin>>dest;

F.open("tour.dat",ios::in | ios::out | ios::binary);

if(F.fail())

cout<<"Can't open file "<<endl;

else

while(F.read((char*)&b,sizeof(b)))

if(strcmp(b.getDestination(),dest)==0)

b.show();

cout<<"Enter the customer name ";


cin>>cname;

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)

cout<<"No Bus Found"<<endl;

F.close();
break;}

case 6:

Ticket t;

cout<<"Booked Tickets "<<endl;

G.open("tickets.dat",ios::in | ios::binary);

if(G.fail())

cout<<"can't open file "<<endl;

else

while(G.read((char*)&t,sizeof(t)))

t.display();

G.close();

cout<<"Press a key to continue ";

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

• ISO/IEC 9899:1990(E), Programming Languages — C (ISO C90 and ANSI C89


standard).
• ISO/IEC 9899:1999(E), Programming Languages — C (revised ISO and ANSI C99
standard).
• ISO/IEC 14882:1998(E), Programming Languages—C++ (ISO and ANSI C++ standard).
• ISO/IEC 14882:2003(E), Programming Languages—C++ (updated ISO and ANSI C++
standard including the contents of [C++98] plus errata corrections).
• ISO/IEC JTC1/SC22/WG21/N1711. (Draft) Technical Report on Standard Library
Extensions (ISO C++ committee working document, November 2004). This is a near-final draft
of the extensions to the C++ standard library due to be published in 2005, including shared_ptr.

You might also like