Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
112 views40 pages

Billing System

This document provides source code for a travel management system in C++. It includes classes for packages with methods to create, view, open, delete, modify packages. It also includes functions for admin to manage the database and for users to see packages, select packages, and get travel passes. The source code handles input/output to binary data files for package storage and retrieval.

Uploaded by

Jacob Pious
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)
112 views40 pages

Billing System

This document provides source code for a travel management system in C++. It includes classes for packages with methods to create, view, open, delete, modify packages. It also includes functions for admin to manage the database and for users to see packages, select packages, and get travel passes. The source code handles input/output to binary data files for package storage and retrieval.

Uploaded by

Jacob Pious
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/ 40

TRAVEL

MANAGEME
NT SYSTEM

DECLARATION  
I hereby declare that the project work entitled BILL
MANAGEMENT SYSTEM submitted in partial fulfillment of the
award of class 12 under the AISSCE 2020-2021 scheme in
Computer Science is a bonafide record of the research carried
out by me under the guidance of Mrs. JINCY SWARUP, Mrs.
BRIGHTY VARGHESE and Mrs. SOBY SUSAN BABU and no part of
it has been submitted for any other study.

Name​:
Signature​:

ACKNOWLEDGEMENT  
First and foremost I thank Lord Almighty for giving me this
thought…

I am happy to express my profound sense of gratitude to Rev.


Fr. Scaria Ethirett CMI, Principal, Placid Vidya Vihar for the
encouragement he gave me throughout the course especially in
the successful completion of this study.

I am deeply indebted to my computer teachers Mrs. Jincy


Swarup, Mrs. Brighty Varghese and Mrs. Soby Susan Babu for
their valuable guidance and support which has been an
indispensible factor in the successful completion this work.

I wish to express my special thanks to all the teachers and the


laboratory staff of Placid Vidya Vihar, Changanassery.

I wish to express my sincere thanks to my parents and friends


who rendered timely help and extended gracious cooperation
throughout my work.

CONTENTS  
1.
Introduction……………………………………………………
……….5 2. Python
Review……………………………………………………………
…6 3. Method
Description…………………………………………………8 4.
System
Specifications……………………………………………….9 5.
Flow of
Control…………………………………………………………1
0
6. Source
Code……………………………………………………………..1
1 7.
Output……………………………………………………………
…………28 8.
Conclusion………………………………………………………
………..38 9.
Bibliography……………………………………………………
………..39
4

INTRODUCTION  
A is a private retailer or public service that provides travel
and tourism related services to the public on behalf of
suppliers such as activities, airlines, car rentals, cruise lines,
hotels, railways, travel insurance, and package tours.

The aim of the program is to develop such a software that


enables an administrator to create a database, insert new
data into it, view the existing records, delete an existing
record and to modify the existing data. This program also
provides a user to search for the details of a package of their
choice and view the details the day of departure, duration,
and type of package. The user can also get an estimate of the
rate and print all the details of his journey allowing him to
plan his journey well.

The program makes sure that only the administrator has the
authority to alter or delete the database. This program which
has the above mentioned features has been developed with
the help of C++ programming language.

Python REVIEW  

C++ is a high-level programming language developed by


Bjarne Stroustrup at Bell Labs in early 1980. C++ adds object
oriented features to its predecessor, C. C++ is one of the
most popular programming languages for graphical
applications, such as those that run in Windows and
Macintosh environments.

Object Oriented Programming   


In OOPs, we approach a problem in terms of objects. It
models the real world well. Object oriented programming is a
method of implementation in which programs are organized
as cooperative collection as objects, each if which represents
instance of some classes and whose classes are all members
of a hierarchy of classes united via inheritance relationship.

The main concepts of OOPs are:


1. ​Data Abstraction
Abstraction refers to the act of representing essential
features without including background details or
explanations.
6
2. ​Data Encapsulation
The wrapping up of data and functions (that operate on data)
into a single unit (called class) is known as encapsulation. As
direct access to data is not provided, accidental alteration of
data can be prevented.

3. ​Modularity
Modularity is the property of a system that has been
decomposed into a set of cohesive and loosely coupled
modules. In modularity, we break down a complex program
into small and understandable fragments. Thus modularity
reduces complexity and increases understandability.
4. ​Inheritance
It is a capability of one class of things to inherit capabilities or
properties from another class. Inheritance brings about the
idea of reusability of codes. Inheritance allows the addition
of additional features to an existing class without modifying
it. It also exhibits transitive nature. If a class A inherits the
properties of another class B, then all subclasses of A will
automatically inherit the properties of B.

5. ​Polymorphism
It is the ability of a message or data to be processed in more
than one form. Polymorphism is the property by which same
messages can be sent to objects of different classes.
7

METHOD DESCRIPTION  

The program ‘Travel Management System’ aims in undertaking


the management of travel agency database using Python
programming language. It is based on OOP’s concept and data
file handling techniques.

The program is divided into two main sections namely:


I. ​Admin
This section contains five functions that enable the
administrator to manage the database.

1. ​Create Package ​: This function helps the administrator


to create a new package and scraps off unwanted
data from the database.
2. ​New Package ​: This function helps to enter the details
of a new package into an existing set of records.
3. ​View ​: This function helps to search and display the
details of a particular package or the entire database. 4.
Delete ​: This function helps to an existing record from
the database.
5. ​Modify ​: This function helps to modify a record.

II. ​User
​This section contains three functions meant for users:
1. ​See Package ​: This function enables a user to get the
details of desired package.
2. ​Select Package ​: This function enables a user to book the
choice of package.
3. ​Get Pass ​: This function enables a user to download the
user ticket.

SYSTEM SPECIFICATIONS  

Hardware:
• Processor: Intel Core Duo or AMD equivalent
• Memory: 512 MB RAM

Software:
• Operating System: Windows 7 OS or higher •
Compiler: Python

10

FLOW OF CONTROL  
TRAVEL MANAGEMENT
ADMIN
USER EXIT

CREATE
PACKAGE
SELECT

NEW PACKAGE

PACKAGE GET
VIEW

DELETE PASS

MODIFY

SEE PACKAGE

11

SOURCE
CODE
12
#include<conio.h>
#include<iostream.h>
#include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#include<string.h>
#include<iomanip.h>
#include<math.h>
#include<fstream.h>
#include<graphics.h>
#include<process.h>
class Package
{
long code;
char Pname[200],days[10],ttype[25],ddate[50];
long rate;
public:
long getcode()
{
return(code);
}
char* getPname()
{
return Pname;
}
char* getdays()
{
return days;
}
13
char* getttype()

{
return ttype;
}
char* getddate()
{
return ddate;
}
long getrate()
{
return rate;
}
void CreateP();
void ViewP();
int Open(int);
void NewP(int);
void DeleteP();
void ModifyP();
}Pp;
void Package::CreateP()
{
cout<<"Enter Code of Package:"<<endl;
cin>>code;
cout<<"Enter name of Package:"<<endl;
gets(Pname);
cout<<"Enter duration:"<<endl;
gets(days);
cout<<"Enter Package type:"<<endl;
gets(ttype);
14
cout<<"Enter Departure date:"<<endl;

gets(ddate);
cout<<"Enter rate:"<<endl;
cin>>rate;
}
void Package::ViewP()
{
cout<<"\n\t\t*************************************"<<
endl;
cout<<"\n\t\tPackage Code : "<<code;
cout<<"\n\t\tPackage Name : "<<Pname;
cout<<"\n\t\tTrip Type : "<<ttype;
cout<<"\n\t\tDuration : "<<days;
cout<<"\n\t\tDeparture Date : "<<ddate;
cout<<"\n\t\tPackage Rate : Starting from "<<rate;
cout<<"\n\t\t**************************************
" <<endl;
}
int Package::Open(int id)
{
int flag=0;
Package p;
ifstream fin("Package.dat",ios::binary);
fin.seekg(0);
while(!fin.eof())
{
if(fin.eof())
break;
fin.read((char*)&p,sizeof(p));
15
if(p.getcode()==id)

{
flag=1;
p.ViewP();
return flag;
}
}
fin.close();
return(0);
}
void Package::DeleteP()
{
fstream fin,fout;
Package pk;
long id;
fin.open("Package.dat",ios::binary|ios::in);
fout.open("Temp.dat",ios::binary|ios::out);
cout<<"\nEnter Code of package to be deleted:"<<endl;
cin>>id;
fin.seekg(0);
while(fin.read((char*)&pk,sizeof(pk)))
{
if(fin.fail())
{
cout<<"fail";
cout<<"\a\a";
getch();
}

16
if(fin.eof())

break;
if(pk.getcode()!=id)
fout.write((char*)&pk,sizeof(pk));
}
fin.close();
fout.close();
remove("Package.dat");
rename("Temp.dat","Package.dat");
cout<<"\t\tPackage has been deleted"<<endl;
}
void Package::NewP(int code)
{
Package p1,p2;
ifstream fin("Package.dat",ios::binary);
ofstream fout("Tmp.dat",ios::binary|ios::app);
int n=0;
fin.seekg(0);
while(fin.read((char*)&p1,sizeof(p1)))
{
if(code<=p1.getcode())
{
p2.CreateP();
fout.write((char*)&p2, sizeof(p2));
n=1;
break;
}
else
{
17
fout.write((char*)&p1,sizeof(p1));

}
}
if(n==0)
{
p2.CreateP();
fout.write((char*)&p2,sizeof(p2));
}
else
{
while(fin.read((char*)&p1,sizeof(p1)))
{
fout.write((char*)&p1,sizeof(p1));
}
}
cout<<"\n\t\tPackage has been inserted.";
fin.close();
fout.close();
remove("Package.dat");
rename("Tmp.dat","Package.dat");
}
void Package::ModifyP()
{
fstream f;
f.open("Package.dat",ios::binary|ios::in|ios::out);
Package p;
char found='n';
int cd;
cout<<"Enter code of package to be modified"<<endl;
18
cin>>cd;

while(f.read((char*)&p,sizeof(p)))
{
if(cd==p.getcode())
{
found='y';
p.CreateP();
f.seekp(f.tellg()-sizeof(p));
f.write((char*)&p,sizeof(p));
cout<<"Package modified"<<endl;
break;
}
}
if(found=='n')
cout<<"Package not found"<<endl;
f.close();
}
class user
{
int tcode;
char tname[50];
int tp;
char tpname[100];
long tpno;
char email[30];
float fare,tfare;
void calcfare();
public:
int gettcode()
19
{

return tcode;
}
char*gtpname()
{
return(tpname);
}
void enterd();
void bookp();
void print();
}U;
void user::enterd()
{
cout<<"\n\t\t***************************************
*********";
cout<<"\n\t\tCheck In Information"<<endl;
cout<<"\n\t\tEnter name:";
gets(tname);
cout<<"\n\t\tEnter the no. of passengers:";
cin>>tp;
cout<<"\n\t\tEnter contact no:";
cin>>tpno;
cout<<"\n\t\tEnter contact email id:";
gets(email);
cout<<"\n\t\t**************************************
**********";
}
void user::bookp()
{
20
​cout<<" \n\t\t\tEnter prefered code:"; cin>>tcode;
ifstream fin("Package.dat",ios::binary);
while (fin.read((char*)&Pp,sizeof(Pp)))
{
if (tcode==Pp.getcode())
strcpy(tpname,Pp.getPname());
}
cout<<"\t\t\t\t\nBOOKED\n\n\n\n";
fin.close();
}
void user::calcfare()
{
ifstream fin("Package.dat",ios::binary);
while (fin.read((char*)&Pp,sizeof(Pp)))
{
if(tcode==Pp.getcode())
fare=Pp.getrate();
}
tfare=tp*fare;
fin.close();
}
void user::print()
{
calcfare();
cout<<"\n\t\t>>>>>>>>>>>>>>>>>>>>>Passenger Pass>>>>>>
>>>>>>>>>>>>>>>>>";
cout<<"\n \t Package code:"<<tcode;
cout<<"\n\n\t Package name:"<<tpname <<"\n\n\t
Passenger Details \n"
21
<<" \n\t Name:"<<tname

<<"\n\n\t No of Passengers:"<<tp
<<"\n\n\t Contact no:"<<tpno
<<"\n\n\t Email id:"<<email
<<"\n\n\t\t>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>";
}
void seep()
{
fstream f; int n,uc;
f.open("Package.dat",ios::binary|ios::in);
while(f.read((char*)&Pp,sizeof(Pp)))
{
cout<<endl<<"\t\t\n"<<Pp.getcode()<<". "<<Pp.getPname();
}
cout<<"\n\nEnter code of your choice:";
cin>>uc;
n=0;
f.close();
f.open("Package.dat",ios::binary|ios::in);
while(f.read((char*)&Pp,sizeof(Pp)))
{
if(uc==Pp.getcode())
Pp.Open(uc);
n=1;
}
if(n==0)
cout<<"\n\t\tPackage doesnt exits\n\n\t\t SESSION
EXPIRED\n";
22
f.close();

}
void Admin()
{
char pass[]="lanka";
char id[]="voyager2019";
char p[10], i[25],pw;
cout<<"\n\t\t\tAdmin ID:";
gets(i);
cout<<"\n\t\t\tPassword:";
for(int l=0;l<10;l++)
{
pw=getch(); cout<<"*";
p[l]=pw;
if((int)pw==13)
{p[l]='\0'; break;}
}
clrscr();
char q;
char ch; fstream fin,fout;
if(strcmp(pass,p)==0 && strcmp(id,i)==0)
{
do
{
clrscr();
cout<<"\n\n\t\t\tVOYAGER MENU\n"
<<"\t\t.............................";
cout<<"\n\n\t\t 1.Create Package"
<<"\n\n\t\t 2.New Package"
23
<<"\n\n\t\t 3.View Package"
<<"\n\n\t\t 4.Delete Package"
<<"\n\n\t\t 5.Modify Package";
cout<<"\n\n\t\tEnter Choice(1,2,3,4,5): ";
int d;
cin>>d;
switch(d)
{
case 1:clrscr();
fout.open("Package.dat",ios::binary|ios::app);
cout<<"\n\n\t\tDATABASE CREATION\n"; do
{cout<<"\n\t\tPackage Details\n";
Pp.CreateP();
fout.write((char*)&Pp,sizeof(Pp));
cout<<"\nDo you want to enter one more
record?(y/n)";
cin>>q;
}while(q=='y'||q=='Y');
fout.close();
break;
case 2: cout<<"Enter new package code";
long no; cin>>no;
Pp.NewP(no);
break;
case 3: int count;
fin.open("Package.dat",ios::in|ios::binary);
while(fin.read((char*)&Pp,sizeof(Pp))) {
24
count++;

Pp.ViewP();
if(count%2==0)
{
getch();
clrscr();
}
}
fin.close();
break;
case 4: Pp.DeleteP();
break;
case 5: Pp.ModifyP();
break;
}
cout<<"\n\t\tDo you want to continue?(y/n)";
cin>>ch;
} while(ch=='y'||ch=='Y');
}
else
{
cout<<"\n\n\t\t\tACCESS DENIED";
getch();
}
}
void Userr()
{
char chara;
do
25
{
clrscr();
cout<<"\n\t\t\t\tTRAVELLER MENU\n"
<<"\t\t\t..........................."
<<"\n\n\t\t\t 1.See Packages"
<<"\n\n\t\t\t 2.Select Package"
<<"\n\n\t\t\t 3.Get pass"
<<"\n\n\t\t\t Enter choice(1,2,3):";
int opt;
cin>>opt;
switch(opt)
{
case 1: seep();
break;
case 2: U.enterd();
U.bookp();
break;
case 3: U.print();
break;
}
cout<<"\n\t\t\tDo you want to continue(y/n)";
cin>>chara;
}while(chara=='y'||chara=='Y');
}
void main()
{
int ch;
clrscr();
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
26
cout<<"\t >>>>>>> >>>>>>> >>>>>>> >>>>>>> >> >>

>>>>>>> >> >>\n "
<<"\t >> > > >> >> >> >> >> >> >> >>\n " <<"\t >> >>>>
>>>>>>> > >>>>>>> >> >> >> >>>>>>> >>>>>>\n "
<<"\t >> >>>> > > >> >> >>>> >>>> >> >> >>\n "
<<"\t >>>>>>>> > >>>>>>> > >> >> >>> >>> >> >> >>>>>\n
";
cout<<"\n\n\t\t\t\t\t\t\tJOURNEYS BEYOND THE MAP";
getch();
do
{
clrscr();
cout<<"\n\t\t\t\tMAIN MENU"<<endl;
cout<<"\n\t\t\t1. Admin Mode"<<endl
<<"\n\t\t\t2. User Mode"<<endl
<<"\n\t\t\t3. Exit"<<endl;
cout<<"\n\t\t\tEnter your choice(1,2,3):";
cin>>ch;
switch(ch)
{
case 1: Admin();
break;
case 2: Userr();
break;
case 3: exit(0);
}
}while(1); }
27

OUTPUT
28
29
30
31
32
33
34
35
36
37

CONCLUSION  

By this project, we were able to learn a lot about TRAVEL


MANAGEMENT SYSTEMS and data file handling concepts. This
project has helped us to get a deeper knowledge of the C++
programming language.

We believe that we have made use of our knowledge in C++ to


make this project a success. This program was compiled and
rectified of all errors. It was run and the desired output was
obtained.
38

BIBLIOGRAPH
Y   
∙ ​Computer Science with C++ - Sumita Arora
39

You might also like