You are on page 1of 43

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

“JNANA SANGAMA
” , BELAGAVI-590018, KARNATAKA

Mini Project Report


On
S

“BIKE RESARVATION SYSTEM



Submitted in partial fulfillment of the requirement for completion of File Structures
Laboratory with Miniproject of VI semester

BACHELOR OF ENGINEERING
In
INFORMATION SCIENCE AND ENGINEERING

Submitted By

RITISH H 1VA15IS
034
SATVIKSHEETY M K 1VA16IS
055
KIRAN H P 1VA17IS
022

Under the Guidance of


Mrs. Sreelatha P K Mrs. Mamatha G
Assistant Professor Assistant Professor
Department of CS&E Department of IS&E

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING


SAI VIDYA INSTITUTE OF TECHNOLOGY
(Affiliated to Visvesvaraya Technological University, Belagavi | Recognized by Govt. of Karnataka | Approved by AICTE, New Delhi)

– 560 064
RAJANUKUNTE, BENGALURU
2019-20
S
ACKNOWLEDGEMENT

The completion of Mini project brings with and sense of satisfaction, but it is never
completed without thanking the persons who are all responsible for its successful
completion. First and foremost I wish to express our deep sincere feelings of gratitude to
my Institution, Sai Vidya Institute of Technology, for providing mean opportunity to do
our education.

I would like to thank the Management and Prof. M R Holla, Director, Sai Vidya
Institute of Technology for providing the facilities.

I extend my deep sense of sincere gratitude to Dr. H S Ramesh Babu, Principal,


Sai Vidya Institute of Technology, Bengaluru, for having permitted to carry out the Mini
project work on “BIKE RESARAVATION SYSTEM” successfully.

I am thankful to Prof. A M Padma Reddy, Additional Director and Professor,


Department of Computer Science and Engineering, Sai Vidya Institute of Technology, for
his constant support and motivation.

I express my heartfelt sincere gratitude to Dr.Vrinda Shetty, Professor and Head,


Department of Information Science and Engineering, Sai Vidya Institute of Technology,
Bengaluru, for her valuable suggestions and support.

I express my sincere gratitude to Mrs. Sreelatha P K, Assistant Professor,


Department of CSE, and Mrs. Mamatha G, Assistant Professor, Department of ISE, Sai
Vidya Institute of Technology, Bengaluru, for their constant support in completing the
Mini project.

Finally, I would like to thank all the Teaching, Technical faculty and supporting
staff members of Department of Information Science and Engineering, Sai Vidya Institute
of Technology, Bengaluru, for their support.

Ritish H 1VA15IS034
SativikSheety M K 1VA16IS055
Kiran H P 1VA17IS022

I
ABSTRACT
Nowadays, there are online bike reservations which give much benefit to user. A rental
service is a service in which customers arrive to request the hire of a rental unit. It is more
convenient than carrying the cost of owning and maintaining the unit.

A bike rental or bike hire agency is a company that rents automobiles for short period of
time for a fee whether in a few hours or a few days or week. It is an extended form of a
rental shop, often organized with numerous local branches (which allow a user to return a
vehicle to a different location), and primarily 'located near airports or busy city areas and
often complemented by a website allowing online reservations.

Bike rental agencies primarily serve people who have a car that is temporarily out of
reach or out of service, for example travellers who are out of town or owners of damaged
or destroyed vehicles who are awaiting repair or insurance compensation. Because of the
variety of sizes of their vehicles, bike rental agencies may also serve the self-moving
industry needs, by renting vans or trucks, and in certain markets other types of vehicles
such as cars may also be offered.

In short, it is a system design specially for large, premium and small bike rental business.
The bike rental system provides complete functionality of listing and booking bike.

Table of Contents

II
ACKNOWLEDGEMENT.....................................................................................................I
ABSTRACT...........................................................................................................................II
TABLE OF CONTENTS....................................................................................................III
LIST OF FIGURES..............................................................................................................V
LIST OF TABLES...............................................................................................................VI

CHAPTER 1
INTRODUCTION ............................................................................................................. 1
1.1 Aim .................................................................................................................................
1
1.2 Introduction to File Structures ....................................................................................... 1
1.3 File Access Operations ...................................................................................................
2
1.4 Record Access ................................................................................................................ 2
CHAPTER 2
REQUIREMENT SPECIFICATION .............................................................................. 4
2.1 Functional Requirements .............................................................................................. 4
2.2 Non Functional Requriments ......................................................................................... 4
2.3 Software requirements ................................................................................................... 5
2.4 Hardware requirements .................................................................................................. 5

CHAPTER 3
DESIGN .............................................................................................................................. 6
3.1 Data Flow Diagram and its Notations ............................................................................ 6
3.2 Data Flow Diagram Example ........................................................................................ 8
3.3 Design Structure ............................................................................................................ 8

CHAPTER 4
IMPLEMENTATION ....................................................................................................... 9
4.1 Libraries and Frameworks ............................................................................................ 9
4.2 Computer Graphics: ....................................................................................................... 9
4.3 Functional Modules .....................................................................................................
10 CHAPTER 5

III
SOURCE CODE………………………………………………………………………..11

CHAPTER 6
5.1 TEST CASES…..…………………………………………………………………..24

CHAPTER 7
SNAPSHOTS .………………………………………………………………………..27

CHAPTER 8
CONCLUSION & FUTURE WORK ............................................................................ 35

BIBLIOGRAPHY .............................................................................................................. 36

List of Figures

Figure No. Figure Name Page No.


Figure 3.2 Data Flow Diagram 8
Figure 3.3 Design Structure 8

List of Tables

IV
Table No. Table Name Page No.
Table 5.1 Test cases 24

V
Bike Reservation System

CHAPTER 1

INTRODUTION

1.1Aim
Read and write student records of variable length records using record length to separate the
records.

1.2Introduction to File Structures


Definition of file structures: A file structure is the organization of data in files and files
in secondary storage and operations for accessing the data. A file structure allows
applications to read, write and modify data. It also supports in finding the data that matches
some search criteria.

The Heart of File Structure Design. Disks are slow compared to RAM or ROM present in the
system. It takes more time to access data from disk when compared with RAM or ROM. On
the other hand they provide enormous capacity to hold data at much lesser cost. Disks are
non-volatile and preserve the information even when the system is turned off. The main
driving force behind the file structure design is the relatively slow access time of disk and its
enormous, non-volatile capacity. Good file structure design will give us access to all the
capacity of disk, without making our application spend a lot of time waiting for the disk. A
file structure is the representation of organizing the data on the secondary memory in a
particular fashion, so that retrieving data becomes easy. An improvement in file structure
design may make an application hundreds of times faster.

A Short History of file structure design:


Earlier files were stored on tapes. Access to these tapes was sequential. The cost to access the
tape grew in direct proportion to the size of the file.

Dept. of ISE, SVIT 2019-2020 1


Bike Reservation System

1.3 File Access Operations

Seek time: Seek time is the time taken for a hard disk controller to locate a specific piece of
stored data. Other delays include transfer time (data rate) and rotational delay (latency).

Rotational delay: A rotational delay is the time between information requests and how
long it takes the hard drive to move to the sector where the requested data is located. In other
words, it is a time measurement, in ms (milliseconds), of how long before a rotating drive can
transfer data.

Transfer time: The time it takes to transmit or move data from one place to another. It is
the time interval between starting the transfer and the completion of the transfer. "Transfer
time."

Disk access time: Disk access times are measured in milliseconds (thousandths of a
second), often abbreviated as ms. Fast hard disk drives for personal computers boast access
times of about 9 to 15 milliseconds. Note that this is about 200 times slower than average
DRAM.

1.4 Record access

Indexing: Indexing is a way to optimize the performance of a database by minimizing the


number of disk accesses required when a query is processed. It is a data structure technique
which is used to quickly locate and access the data in a database. Indexes are created using a
few database columns.

B- tree: A B-tree is a self-balancing tree data structure that maintains sorted data and allows
searches, sequential access, insertions, and deletions in logarithmic time. The B- tree
generalizes the binary search tree, allowing for nodes with more than two children.

B+ tree: A B+ tree is an m-ary tree with a variable but often large number of children per
node. A B+ tree consists of a root, internal nodes and leaves. The root may be either a leaf or
a node with two or more children.

Dept. of ISE, SVIT 2019-2020 2


Bike Reservation System

Hashing: Hashing is the transformation of a string of characters into a usually shorter


fixed-length value or key that represents the original string. Hashing is used to index and
retrieve items in a database because it is faster to find the item using the shorter hashed key
than to find it using the original value.

Dept. of ISE, SVIT 2019-2020 3


Bike Reservation System

CHAPTER 2
REQUIREMENTS SPECIFICATION

2.1 FUNCTIONAL REQUIREMENTS


A description of the facility or feature required. Functional requirements deal with
what the system should do or provide for users. They include description of the required
functions, outlines of associated reports or online queries, and details of data to be held in the
system.

2.1.1 Interface Requirements:


An interface requirement is a system requirement that involves an interaction with another
system. The format of the interface requirement is such that it includes a reference (pointer)
to the specific location in the definition document that defines the interface.

2.2 NON FUNCTIONAL REQUIREMENTS:


Non-functional requirements define the overall qualities or attributes of the resulting system.

2.2.1 Usability
Usability is the ease with which a user can learn to operate and get instant information about
donors, hospitals and nearby blood banks.

2.2.2 Security
Security requirements are included in a system to ensure:

 Enquiries from the end users as well as from any organization are highly secured.

2.2.3 Reliability
Reliability is the ability of a system to perform its required functions under stated
conditions for a specific period of time. Constraints on the run-time behavior of the system
can be considered under two separate headings:

• Availability: is the system available for service when requested by end-users.

Dept. of ISE, SVIT 2019-2020 4


Bike Reservation System

• Failure rate: how often does the system fail to deliver the service as expected by
endusers.

2.2.4. Efficiency
The comparison of what is actually produced or performed with what can be achieved
with the same consumption of Clouds (money, time, labor, etc.). It is an important Factor in
Determination of Productivity.

2.3 Software Requirements


Programming language : C++
Operating system : ANY OS (Recommended: Windows8,
Windows Vista, Windows XP)
Application required : TURBO C++

2.4 Hardware Requirements


C.P.U : Pentium IV 2.4 GHz or above
Memory (Primary) : 512 MB, 1 GB or above
Hard Disk : 40 GB, 80GB, 160GB or above
Monitor : 15 VGA color

CHAPTER 3
DESIGN

This chapter of the report describes the structure of the project, followed by Data Flow
Diagram.

Dept. of ISE, SVIT 2019-2020 5


Bike Reservation System

3.1 DATA FLOW DIAGRAM AND ITS NOTATIONS


A data flow diagram (DFD) is a graphical representation of the "flow" of data through an
information system, modeling its process aspects. A DFD is often used as a preliminary step
to create an overview of the system without going into great detail, which can later be
elaborated. DFDs can also be used for the visualization of data processing.
A DFD shows what kind of information will be input to and output from the system, how the
data will advance through the system, and where the data will be stored. It does not show
information about process timing or whether processes will operate in sequence or in parallel,
unlike a traditional structured flowchart which focuses on control flow, or a UML activity
workflow diagram, which presents both control and data, flows as a unified model.
All data flow diagrams include four main elements: entity, process, data store and data flow.

External Entity – Also known as actors, sources or sinks, and terminators, external entities
produce and consume data that flows between the entity and the system being diagrammed.
These data flows are the inputs and outputs of the DFD. Since they are external to the system
being analyzed, these entities are typically placed at the boundaries of the diagram. They can
represent another system or indicate a subsystem.

Process – An activity that changes or transforms data flows. Since they transform incoming
data to outgoing data, all processes must have inputs and outputs on a DFD. This symbol is
given a simple name based on its function, such as “Ship Order,” rather than being labeled
“process” on a diagram. In notation, a rectangular box is used and may be labeled with a
reference number, location of where in the system the process occurs and a short title that
describes its function. Processes are typically oriented from top to bottom and left to right on
a data flow diagram.

Data Store – A data store does not generate any operations but simply holds data for later
access. Data stores could consist of files held long term or a batch of documents stored
briefly while they wait to be processed. Input flows to a data store include information or
operations that change the stored data. Output flows would be data retrieved from the store.

Data Flow – Movement of data between external entities, processes and data stores is
represented with an arrow symbol, which indicates the direction of flow. This data could be
Dept. of ISE, SVIT 2019-2020 6
Bike Reservation System

electronic, written or verbal. Input and output data flows are labeled based on the type of data
or its associated process or data store, and this name is written alongside the arrow.

Fig 3.1: Notations.

3.2 DATA FLOW DIAGRAM EXAMPLE:

Fig 3.2: DFD Example.

3.3 DESIGN STRUCTURE:

Dept. of ISE, SVIT 2019-2020 7


Bike Reservation System

Details report
Design
user administratio
Registration
system n
details

Fig: 3.3 Design structure

CHAPTER4
IMPLEMENTATIONS

This chapter of the report describes the Functions, packages and modules used in the
project:

4.1 Libraries and Frameworks


C++: C++ is a programming language. It has imperative, object oriented and generic
programming features, while also providing facilities for low level memory manipulation. C+
+ is a compiled language, with the implementation of it available on many platforms. It was
designed with a bias towards system programming and embedded, resource-constrained and
large systems, with performance, efficiency and flexibility of use as its design highlights. C+
+ has also been found useful in many other contexts, with key strengths being software
infrastructure and resource constrained applications, Including desktop application, servers
and performance critical applications.

4.2 Computer Graphics:

Dept. of ISE, SVIT 2019-2020 8


Bike Reservation System

Computer graphics are pictures and films created using computers. Usually the term refers to
computer-generated image data created with help from specialized graphical hardware
and software. It is a vast and recent area in computer science. It is often abbreviated as CG,
though sometimes erroneously referred to as computer generated imagery or CGI. Computer
graphics is responsible for displaying art and image data effectively and meaningfully to the
user. It is also used for processing image data received from the physical world. Computer
graphic development has had a significant impact on many types of media and has
revolutionized animation, movies, advertising, video games, and graphic design generally.

4.3 Functional Modules:


The functional modules included in the project are listed below:
Insert Module: This module provides the functionality of collecting the required data from
the designed interface and transmitting it to the appropriate file present in the database
designed for this project.

Delete Module:
The delete counterpart is loaded with the ability to unregister a single or multiple
records from the file. It searches for the record, in the query specified file, based on the
provided value for an attribute.

Update Module:
This module provides the functionality of updating the employee’s details with
previous record.

Retrieve\Search Module:
This module will help the administrator in searching the employees with various
criteria easily

Load Index Module:


Load Index as the name describes, loads the primary and secondary indexes from
physical and secondary indexes from physical memory (files) to main memory. Loading the
indexes to main memory results in fast and efficient performance of operations like sorting.

Dept. of ISE, SVIT 2019-2020 9


Bike Reservation System

Write Index Module:


Write Index as the name describes, the functionality of writing the indexes from main
memory to respective files in secondary storage. So that it can again be loaded to main
memory and perform operations on the data.

CHAPTER 5
SOURCE CODE
#include<iostream>
#include<fstream> #include<string.h>
#include<cstdlib>
#include<windows.h>
#include<conio.h>
#include<time.h>
using namespace std;
string u_name; class
bike
{
public:char rrn[2];
char bid[5];
char bname[15];
char borigin[10];
char bprice[10];
char bnumber[10];
}; class
user
{
public:char uid[5];
char uname[15]; char
upwd[15]; char
uaddress[20];
char uphone[11];
};
fstream file1,file2,file3,file4,file5; void
binsert()

Dept. of ISE, SVIT 2019-2020 10


Bike Reservation System

{
string line; int count=0;
char buffer[144];
file1.open("indexf.txt",ios::app);
file2.open("bikes.txt",ios::in);
system("cls");
cout<<" BIKE RENTAL SYSTEM \n";
if(!file2)
{
cout<<"\nWELCOME TO BIKE RENTAL SYSTEM";
}
bike b;
do
{

cout<<"\nB
ike
name(15)
: ";
cin>>b.bname;
}while(strlen(b.bname)>=15);
do
{
cout<<"\n"<<"\tBike origin(10) : ";
cin>>b.borigin;
}while(strlen(b.borigin)>=10);
do
{
cout<<"\n"<<"\tBike price(10) : ";
cin>>b.bprice;
}while(strlen(b.bprice)>=10);
do
{
cout<<"\n"<<"\tBike number : ";
cin>>b.bnumber;
}while(strlen(b.bnumber)>10);
while(getline(file2,line))
{
count++;
}
file2.close();
file2.open("bikes.txt",ios::app);
file3.open("index1.txt",ios::app);

file2<<count+1<<"|"<<b.bname<<"|"<<b.borigin<<"|"<<b.bprice<<"|"<<b.bnumber<<"!"<<
"\n";

Dept. of ISE, SVIT 2019-2020 11


Bike Reservation System

file1<<b.bname<<"|"<<count+1<<"!"<<"\n";
file3<<b.bnumber<<"|"<<count+1<<"!"<<"\n";
file1.close(); file2.close(); file3.close();
cout<<"\n"<<"bike added successfully!!! : ";
Sleep(500);
}
void bdelete()
{
string line;
int count=0,i=0,found=99999,choice;
char name[20],x[2];
file2.open("bikes.txt",ios::in);
while(getline(file2,line))
{
count++;
}
file2.close();
file2.open("bikes.txt",ios::in); bike
b[count];
while(i<count)
{
file2.getline(b[i].rrn,2,'|');
file2.getline(b[i].bname,15,'|');
file2.getline(b[i].borigin,10,'|');
file2.getline(b[i].bprice,10,'|');
file2.getline(b[i].bnumber,10,'!');
file2.getline(x,2,'\n');
i++;
}
file2.close(); system("cls");
cout<<"\nBIKE RENTAL\n";
cout<<"\nEnter bike name to delete:\t";
cin>>name;
for(int l=0;l<count;l++)
{
if(strcmp(name,b[l].bname)==0)
{
found=l;
break;
}
}
if(found==99999)
{
system("cls");
cout<<"\n PHONEBOOK\n";
cout<<"\n no contacts found";
Sleep(800);
Dept. of ISE, SVIT 2019-2020 12
Bike Reservation System

return;
}
else
{
int n=0;
file2.open("bikes.txt",ios::out);
file1.open("indexf.txt",ios::out); file3.open("index1.txt",ios::out);
for(int k=0;k<count;k++)
{
if(k==found) continue;
file1<<b[k].bname<<"|"<<n+1<<"!"<<"\n";
file3<<b[k].bnumber<<"|"<<n+1<<"!"<<"\n";

file2<<n+1<<"|"<<b[k].bname<<"|"<<b[k].borigin<<"|"<<b[k].bprice<<"|"<<b[k].bn
umber<<"!"<<"\n";
n++;
}
cout<<"bike has been deleted successfully";
file1.close();
file2.close();
file3.close();
}
}
void searchb()
{
int choice,flag=0; string line;
char x[2]; system("cls");
cout<<" BIKE RENTAL \n";
cout<<"1...Search By Bike Name..\n";
cout<<"2...Search By Bike Number..\n";
cout<<"Enter your choice\t";
cin>>choice;
char name[15],number[10],rrn[2],name1[15],number1[10];
int rrn1;
if(choice==1)
{
file1.open("indexf.txt",ios::in);
cout<<"\n Enter the bike name to search \t";
cin>>name; system("cls");
cout<<" BIKE RENTAL \n";
while(!file1.eof())
{
file1.getline(name1,15,'|');
file1.getline(rrn,2,'!');
file1.getline(x,2,'\n');
if(strcmp(name1,name)==0)
{
Dept. of ISE, SVIT 2019-2020 13
Bike Reservation System

flag=1;
break;
}

}
file1.close();
if(flag==0)
{
cout<<"\n bike not found";
Sleep(5000);
return;
}
file2.open("bikes.txt",ios::in);
bike b;
rrn1=atoi(rrn); for(int
j=1;j<rrn1;j++)
getline(file1,line);
//file2.getline(b.rrn,2,'
|');
file2.getline(b.bid,5,'|'
);
file2.getline(b.bname,
15,'|');
file2.getline(b.borigin
,10,'|');
file2.getline(b.bprice,10,'|');
file2.getline(b.bnumber,10,'!');
file2.getline(x,2,'\n');
file2.close();
printf("\n\tbid\tbname\tborigin\tbprice\tbike number\n");
cout<<"\n\t----------------------------------------------------";
printf("\n\t%s\t%s\t%s\t%s\t%s\n",b.bid,b.bname,b.borigin,b.bprice,b.bnumber);
cout<<"\n\tPress any key to continue"; getch();
//file1.close();
}
else if(choice==2)
{
file3.open("index1.txt",ios::in);
cout<<"\nEnter the bike number to search\t";
cin>>number;
system("cls");
cout<<"BIKE RENTAL\n";
while(!file3.eof())
{

Dept. of ISE, SVIT 2019-2020 14


Bike Reservation System

file3.getline(number1,10,'|');
file3.getline(rrn,2,'!');
file3.getline(x,2,'\n');
if(strcmp(number1,number)==0)
{
flag=1;
break;
}
}
file3.close();
if(flag==0)
{
cout<<"\n\t bike not found";
Sleep(500);
return;
}
file2.open("bikes.txt",ios::in);
bike b;
rrn1=atoi(rrn);
for(int j=1;j<rrn1;j++){
getline(file1,line);
}
//file2.getline(b.rrn,2,'|');
file2.getline(b.bid,5,'|');
file2.getline(b.bname,15,'|');
file2.getline(b.borigin,10,'|');
file2.getline(b.bprice,10,'|');
file2.getline(b.bnumber,10,'!');
file2.getline(x,2,'\n');
file2.close();
printf("\n\tbid\tbname\tborigin\tbprice\tbike number\n");
cout<<"\n\t----------------------------------------------------";
printf("\n\t%s\t%s\t%s\t%s\t%s\n",b.bid,b.bname,b.borigin,b.bprice,b.bnumber);
/*printf("\n\tbid\tbname\tborigin\tbprice\tbike number\n");
cout<<"\n\t------------------------------------------------------";
printf("\n%s\t%s\t%s\t%s\t%s\n",b.bid,b.bname,b.borigin,b.bprice,b.bnumber);
cout<<"\n\tPress any key to continue";*/ getch();
//file2.close();
}
else
{
cout<<"Invalid choice";
}}
void modifyb()
{
string line;

Dept. of ISE, SVIT 2019-2020 15


Bike Reservation System

int count=0,i=0,found=99999,choice;
char name[20],x[2];
file2.open("bikes.txt",ios::in);
while(getline(file2,line))
{
count++;
}
Sleep(300);
file2.close();
file2.open("bikes.txt",ios::in);
bike b[count];
while(i<count)
{
file2.getline(b[i].rrn,5,'|');
file2.getline(b[i].bname,15,'|');
file2.getline(b[i].borigin,10,'|');
file2.getline(b[i].bprice,10,'|');
file2.getline(b[i].bnumber,10,'!');
file2.getline(x,2,'\n');
i++;
}
file2.close(); system("cls");
cout<<"\tBIKE RENTAL\n";
cout<<"\nEnter the bike name : \t";
cin>>name; for(int
l=0;l<count;l++)
{
if(strcmp(name,b[l].bname)==0)
{
found=l;
break;
}
}
if(found==99999)
{
system("cls");
cout<<"\nBIKE RENTAL\n";
cout<<"\nno contacts found";
Sleep(800);
return;
}
system("cls");
cout<<"\tBIKE RENTAL\n";
while(1)
{
cout<<"\n1...BikeName";
cout<<"\n2...Bikeorigin";
Dept. of ISE, SVIT 2019-2020 16
Bike Reservation System

cout<<"\n3...Bikeprice";
cout<<"\n4...Bikenumber";
cout<<"\n5...Exit\n";
cout<<"\nChoose the field to be updated ";
cin>>choice;
system("cls");
cout<<"\nBIKE RENTAL";
switch(choice)
{
case 1: cout<<"\nBike Name : "<<b[found].bname;
cout<<"\nEnter the bike name to update.. ";
cin>>b[found].bname;
break;
case 2: cout<<"\nbike origin : "<<b[found].borigin;
cout<<"\nEnter the bike origin to update.. ";
cin>>b[found].borigin;
break;
case 3: cout<<"\nBike price : "<<b[found].bprice;
cout<<"\nEnter the price to update.. ";
cin>>b[found].bprice;
break;
case 4: cout<<"\n Bike number : "<<b[found].bnumber;
cout<<"\nEnter the bike number to update.. ";
cin>>b[found].bnumber;
break;
case 5: file2.open("bikes.txt",ios::out);
file1.open("indexf.txt",ios::out);
file3.open("index1.txt",ios::out);
cout<<"\n\tUpdating!!!!!!!!";
Sleep(800);
for(int k=0;k<count;k++)
{
file1<<b[k].bname<<"|"<<k+1<<"!"<<"\n";
file3<<b[k].bnumber<<"|"<<k+1<<"!"<<"\n";

file2<<k+1<<"|"<<b[k].bname<<"|"<<b[k].borigin<<"|"<<b[k].bprice<<"|"<<b[k].bn
umber<<"!"<<"\n";
}
file1.close();
file2.close();
file3.close();
cout<<"\nbike details updated successfully";
Sleep(800);
return;
break;
default :cout<<"\nPlease enter a valid choice\n\n";
}
Dept. of ISE, SVIT 2019-2020 17
Bike Reservation System

void display()
{
bike b;
char x[2];
file2.open("bikes.txt",ios::in); while(!
file2.eof())
{
file2.getline(b.bid,5,'|');
file2.getline(b.bname,15,'|');
file2.getline(b.borigin,10,'|');
file2.getline(b.bprice,10,'|');
file2.getline(b.bnumber,10,'!');
file2.getline(x,2,'\n');
printf("\n\tbid\tbname\tborigin\tbprice\tbnumber\n");
cout<<"\n------------------------------------------------";
printf("\n\t%s\t%s\t%s\t%s\t%s\n",b.bid,b.bname,b.borigin,b.bprice,b.bnumber);
}
getch();
file2.close();
}
void bbike()
{ string line;
cout<<"please have a look at our available bikes before booking \n";
display(); int
count=0,i=0,choice; char x[2];
int choice1=1;
file5.open("book.txt",ios::app)
;
file2.open("bikes.txt",ios::in);
while(getline(file2,line))
{
count++;
} file2.close(); bike
name[count];
file1.open("indexf.txt",ios::in);
system("cls");
//cout<<"\nPHONEBOOK\n\n\n\n\n\n";
while(!file1.eof())
{
file1.getline(name[i].bname,15,'|');
file1.getline(name[i].rrn,2,'!');
file1.getline(x,2,'\n');
i++;
Dept. of ISE, SVIT 2019-2020 18
Bike Reservation System

}
for(int j=0;j<count;j++)
{
cout<<"\n"<<"\t"<<name[j].rrn<<"..."<<name[j].bname;
}
cout<<"\n\n"<<"\t0...Exit";
cout<<"\n\n"<<"\t select your bike ";
cin>>choice; if(choice==0)
{
return;
}
else if(choice>=1 && choice<=count)
{
system("cls");
cout<<"booking succesful";
file5<<name[choice-1].bname<<"|"<<u_name<<"!"<<"\n";
}
else
{
cout<<"\n\n"<<"\tinvalid choice";
}
file5.close();
file1.close();
cout<<"\n\n\n\n"<<"\n\n"<<"\tPress any key to exit";
getch();
} void
signup() {
user u;
int ch;
file4.open("userf.txt",ios::app);
system("cls");
if(!file4)
{
cout<<"\nAn error occurred";
}
cout<<"\nuser id : ";
cin>>u.uid;
cout<<"\n"<<"\tuser name : ";
cin>>u.uname;
cout<<"\n"<<"\tpassword : ";
cin>>u.upwd;
cout<<"\n"<<"\taddress : ";
cin>>u.uaddress; cout<<"\n"<<"\tphone
number : ";
cin>>u.uphone;
file4<<u.uid<<"|"<<u.uname<<"|"<<u.upwd<<"|"<<u.uaddress<<"|"<<u.uphone<<"!
"<<"\n";
Dept. of ISE, SVIT 2019-2020 19
Bike Reservation System

cout<<"login successfull";
u_name=u.uname;
while(true)
{
cout<<"enter your choice"; cout<<"\n 1.view
bikes";
cout<<"\n 2.book a bike";
cin>>ch;
switch(ch)
{
case 1:display();
break;
case 2:bbike();
break;
case 3:exit(0);
break;
}
}
bbike();
file4.close();
}
void login()
{
int ch;
char uid1[30],upwd1[20];
int count=0,i=1;
user u;
file4.open("userf.txt",ios::in);
if(!file4)
{
cout<<"file not found \n";
}
cout<<"enter user id \n";
cin>>uid1;
while(!file4.eof())
{
file4.getline(u.uid,5,'|');
file4.getline(u.uname,15,'|');
file4.getline(u.upwd,15,'|');
file4.getline(u.uaddress,20,'|');
file4.getline(u.uphone,11,'!');
if(strcmp(uid1,u.uid)==0)
{
cout<<"enter password";
cin>>upwd1;
if(strcmp(upwd1,u.upwd)==0)
{
Dept. of ISE, SVIT 2019-2020 20
Bike Reservation System

cout<<"login successful \n";


while(true)
{
cout<<"enter your choice \n"; cout<<"\n 1.view
bikes";
cout<<"\n 2.book a bike";
cin>>ch;
switch(ch)
{
case 1:display();
break;
case 2:bbike();
break;
case 3:exit(0);
break;
}
}
}
else
{
cout<<"incorrect password \n";
}

}
else
{
cout<<"user id doesnot exist \n";
}
}
}
int main() {
system("color white");
long int aid=100,apwd=123;
int choice,ch; long int
aid1,apwd1;
while(true)
{
cout<<"enter your choice \n";
cout<<" 1.ADMIN \n";
cout<<" 2.user sign up\n";
cout<<" 3.user login\n";
cout<<" 4.exit \n";
cin>>choice;
switch(choice)
{
case 1: cout<<"enter admin id \n";
cin>>aid1;
Dept. of ISE, SVIT 2019-2020 21
Bike Reservation System

if(aid1==100)
{
cout<<"\n enter admin password \n";
cin>>apwd1;
if(apwd1==123)
{
cout<<"login successfull \n";
while(true)
{
cout<<"enter your choice \n"; cout<<" 1.insert \n"; cout<<"
2.delete \n"; //cout<<" 3.search \n"; cout<<" 4.modify \n";
cout<<" 5.display \n";
cout<<" 6.exit \n";
cin>>ch;
switch(ch)
{
case 1: binsert();
break;
case 2: bdelete();
break;
case 3: searchb();
break;
case 4:modifyb();
break;
case 5:display();
break;
case 6:exit(0);
break;
}
}

}
else
{
cout<<" incorrect password";
exit(0);
}
}
else
{
cout<<"user id doesnot exist";
exit(0);
}
break;
case 2:signup();
break;
case 3:login();
Dept. of ISE, SVIT 2019-2020 22
Bike Reservation System

break;
case 4:exit(0);
break;
default:exit(0);
break;
}

CHAPTER 6
5.1 Test cases:

Test Case Purpose Precondition Test Steps Expected


Test Name Results
Case
No.
01 Register for Enable Customer has Click signup Customer will be
reservation customer to valid phone button. Provide registered in the
register in the number. required system.
system information such
as, name, phone no
.and address

02 View vehicle Enable Customer is Click on a Detailed


description customer to logged in the particular bike. description of all
view detailed system Detailed description vehicles in the
Dept. of ISE, SVIT 2019-2020 23
Bike Reservation System

description of system are


particular of that bike will be displayed upon
vehicle displayed. request.
03 Notify Notify customer Customer is Click on reserve
selection of that selected logged in the bike. Notification is
unavailable bike is system. Get notification that displayed for all
bike while unavailable for Customer has bike is unavailable. unavailable bikes
reservation reservation attempted to in the system
reserve a bike. upon attempt of
reservation.
04 Advanced Enable Customer is All available
search by customer to logged in the search
bike category limit search of system. parameters
vehicle by Select .display display
brand, type and Result will be appropriate
model. displayed according results.
to the parameters
set.

05 Display list of Enable customer Customer is All bikes available


available bikes to view the list of logged into the for reservation
for reservation bikes available system Click on the book will be on the list.
for reservation a A list of bikes
available for
reservation will be
displayed

Dept. of ISE, SVIT 2019-2020 24


Bike Reservation System

06 Cancel Enable customer Customer is Customer


reservation to cancel logged in the will receive a
Select cancel notification of
reservation of system.
reservation. Provide successful
bike Customer has a
reservation cancelation of
vehicle reserved
confirmation reservation. If
number. Reservation failed,
confirmation show error
number will be message.
verified by the
system. Notification
of successful/failed
cancelation will be
displayed.
07 Update Enable to Select update Updated
reservation update reservation information will
information reservation information Make be saved and
information necessary displayed.
changes. Save
changes
Admin is logged
in the system.
Admin has
clearance to
update
information
08 User log in Enable Users to User has If verified,
log in to the required grant access to
system credentials to log Input username the system. If
in Input password not, show error
Select user type message.
Verify username,
password and type
09 Create new Enable new Customer has Customer will be
customer customers to valid phone Click sign up button. registered in the
account use the system number Provide required system.
information such as,
name, phone no.

10 User log out User is logged in Click exit button.


Enable user to
log out of the User will be
system exited out

Dept. of ISE, SVIT 2019-2020 25


Bike Reservation System

10 Register new Enable Input New vehicle


vehicle registration of information of information will
new bike in the vehicle. and be saved and will
system Admin is logged Save be updated.
in register new
vehicle
11 Update bike Enable Admin Select bike Make Updated
information to update bike necessary changes information will
information to to the information be saved and
current status of bike. displayed.
Admin is logged Save changes.
in update bike
information
12 View bike user is logged in Select view all bike
list

Enable users to List of all bikes


view list of all of the company
bikes will be displayed

CHAPTER 7 SNAPSHOTS
The below figure shows the front screen of the project.

Login Page:

Dept. of ISE, SVIT 2019-2020 26


Bike Reservation System

This is the first window which opens when we run the project.
We have to enter the Admin username and password to login. If we enter the correct
username and password it opens the next window.

Admin Menu:

Dept. of ISE, SVIT 2019-2020 27


Bike Reservation System

After we login, admin menu frame pops out. In this we can see several modules.
Only the admin has the permission to use this, where he can enter any number of bike details
And update, delete and modify the bikes.
There is also an exit button where you can exit any time you want.

Bike Registration:

Dept. of ISE, SVIT 2019-2020 28


Bike Reservation System

When we enter the Bike Registration module Admin has to enter all the details of their
bikes with all details of bike along with his price and registration number.

Display Bikes:

Dept. of ISE, SVIT 2019-2020 29


Bike Reservation System

In this module admin can search any bikes stored in the database. Admin can update or delete
the details of his bikes any time.

Modify Bikes:

Dept. of ISE, SVIT 2019-2020 30


Bike Reservation System

In this module admin can modify the name, price and registration number of bikes. based on
admin wish.

User signup:

Dept. of ISE, SVIT 2019-2020 31


Bike Reservation System

In this module the user will create the account with respect to username and password and

address and phone number User login:

Where user will login and they can book a bike.

Reports
User list:

Dept. of ISE, SVIT 2019-2020 32


Bike Reservation System

Bike list:

Bike Number:

Bikename list:

Dept. of ISE, SVIT 2019-2020 33


Bike Reservation System

Dept. of ISE, SVIT 2019-2020 34


Bike Reservation System

CHAPTER 8

CONCLUSION AND FUTURE ENHANCEMENT

It can be observed that computer applications are very important in every field of human
endeavor. Here all the information about customer that made reservation can be viewed just
by clicking a button with this new system, some of the difficulties encountered with the
manual system are overcome. It will also reduce the workload of the staff, reduce the timed
used for making reservation at the bus terminal and also increase efficiency. The application
also has the ability to update records in various file automatically thereby relieving the
company’s staff the stress of working from file security of data.

This project, as a whole, will give a new way in bus reservations and ticketing process. The
automation and management of seats and reservations will be done accordingly. However,
this project doesn’t limit the walk-in passenger i.e., the passengers who visit the company’s
counter because it also caters for them. This also lessens the use of papers like in the
traditional way of ticketing.

Dept. of ISE, SVIT 2019-2020 35


Bike Reservation System

BIBLIOGRAPHY
BOOK REFERENCE

[1] File Structures: An Object-Oriented Approach with C++ 3rd Edition by Michael J.
Folk (Author), Bill Zoellick (Author), Greg Riccardi (Author) [2] Pauline Baker, 2nd
Edition, Pearson Education, 2003.

WEBSITES

[1] www.youtube.com

[2] www.google.com

[3] https://www.geeksforgeeks.org/

[4] www.w3schools.com
Dept., of IS&E, SVIT 2019-20 36

You might also like