Airlines Reservation
Airlines Reservation
Airlines Reservation
PROJECT
SESSION:2009-2010
NAME: PRATIK
KULSHRESTHA
AISSCE ROLL NO: 5673192
CLASS: XII SC. ‘A’
1
CONTENTS
SL NO. CONTENTS PAGE NO.
1. ACKNOWLEDGEMENT 2
2. INTRODUCTION 3
3. USER INTERFACE 5
4. TECHNICAL DESIGN 9
5. SOURCE CODE 17
6. OUTPUT 40
7. CERTIFICATE 48
2
ACKNOWLEDGEMENT
for Airlines.
3
INTRODUCTION
C++ (pronounced "See plus plus") is a statically typed, free-
form, multi-paradigm, compiled, general-purpose programming
language. It is regarded as a middle-level language, as it comprises a
combination of both high-level and low-level language features. It
was developed by a Bjarne stroustrup starting in 1979 at Bell Labs as
an enhancement to the C programming language and originally
named "C with Classes". It was renamed C++ in 1983.[2]
C++ is widely used in the software industry, and remains one of the
most popular languages ever created. Some of its application domains
include systems software, application software, device drivers,
embedded software, high-performance server and client applications,
and entertainment software such asvideo games. Several groups
provide both free and proprietary C++ compiler software, including
the GNU Project, Microsoft, Intel, Borland and others.
C++ is also used for hardware design, where design is initially
described in C++, then analyzed, architecturally constrained, and
scheduled to create a register transfer level hardware description
language via high-level synthesis.
The language began as enhancements to C, first adding classes,
then virtual functions, operator overloading, multiple
inheritance, templates, and exception handling among other features.
After years of development, the C++ programming language standard
was ratified in 1998 as ISO/IEC 14882:1998. That standard is still
current, but is amended by the 2003 technical corrigendum, SO/IEC
14882:2003. The next standard version (known informally as C++0x)
is in development.
In 1983, the name of the language was changed from C with
Classes to C++ (++ being the increment operator in C and C++).
New features were added including virtual functions, function name
and operator overloading, references, constants, user-controlled free-
4
store memory control, improved type checking, and BCPL style
single-line comments with two forward slashes (//).
This software also helps in viewing the Airline Details, Adding New
Airline Details, Getting information about New Scheduled Flights,
Rescheduled Flights and Cancelled Flights under main subdivision
Reservation Details.
All in all the software provides robust and friendly environment for
the users to navigate through an airline ticket reservation.
5
USER INTERFACE
WELCOME TO
AIRLINE MANAGEMENT SOFTWARE
6
********** FLIGHT DETAILS **********
1. ADD ENTRY
2. MODIFY ENTRY
3. DELETE ENTRY
4. VIEW ENTRY
5. GOTO MAIN MENU
ADD ENTRY
Flight No.:
Airlines Name:
Destination: From: To:
Day of Journey:
Time: Arrival: Departure:
No. of Seats: 1st Class: Economy Class:
Fare: 1st Class: Economy Class:
7
********** RESERVATION DETAILS *********
1. ADD RESERVATION
2. MODIFY RESERVATION
3. VIEW RESERVATION
4. GOTO MAIN MENU
ADD RESERVATION
PASSENGER DETAILS
Name:
Age:
Contact Address:
Contact Phone No.:
FLIGHT DETAILS
Flight No.:
Destination: From: To:
Class of Flights:
No. of Seats:
Fare:
Ticket No.:
8
********* ENQUIRY *********
1. Delhi
2. Chennai
3. Mumbai
4. Lucknow
5. Pune
6. Hyderabad
7. Aizawal
8. Jaipur
9. Goto Main Menu
9
TECHNICAL DESIGN
CLASS STRUCTURE
<class>
CLASS NAME
Class description and This class is used to store the
purpose records of various flights available
to the user. It contains flights
names, number, time, day, etc.
10
ATTRIBUTE DATA TYPE
Destfrom,dest_to char
fname char
fno char
day char
seats1 int
seats2 int
fare1 float
fare2 float
arrival,departure char
<METHOD 1>
<METHOD 2>
11
Method of signature view_entry()
<METHOD 3>
<METHOD 4>
12
Method Signature add_entry()
<METHOD 5>
<METHOD 6>
13
Purpose Retuns the number of seats of
business class
<METHOD 7>
<METHOD 8>
14
Purpose Returns the flight number
<METHOD 9>
<METHOD 10>
<METHOD 11>
15
Scope of method public
Return value char
<STRUCTURE>
Destfrom,dest_to char
fno char
day char
tkno int
FILE STRUCTURE
<File 1>:F_INFO.dat
16
Destfrom,dest_to char 15
fname char 25
fno char 6
day char 10
time int 2
seats1 int 2
seats2 int 2
fare1 float 4
fare2 float 4
<File 2>:Record.dat
SOURCE CODE
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<fstream.h>
17
class flight
int fno;
char fname[30];
char destfrom[30],dest_to[30];
char day[10];
char arrival[5],departure[5];
int seats1,seats2,seatsac;
float fare1,fare2,fareac;
public:
void flight_details();
void add_entry();
void modify_entry();
void del_entry();
void view_entry();
int ret()
{return fno;
}; // CLASS DECLARATION
clrscr();
gotoxy(30,4);cout<<"ADD ENTRY";
gotoxy(5,7);cout<<"Flight No.:";cin>>fno;
gotoxy(5,11);cout<<"Destination:";
gotoxy(25,11);cout<<"From:";cin>>destfrom;
gotoxy(45,11);cout<<"To:";cin>>dest_to;
gotoxy(5,13);cout<<"Day Of Journey:";cin>>day;
18
gotoxy(5,15);cout<<"Time:";
gotoxy(25,15);cout<<"Arrival:";cin>>arrival;
gotoxy(45,15);cout<<"Departure:";cin>>departure;
gotoxy(5,17);cout<<"No. Of Seats:";
gotoxy(25,17);cout<<"1st Class:";cin>>seats1;
gotoxy(45,17);cout<<"Economy Class:";cin>>seats2;
gotoxy(5,19);cout<<"Fare:";
gotoxy(25,19);cout<<"1st Class:";cin>>fare1;
gotoxy(45,19);cout<<"Economy Class:";cin>>fare2;
getch();
clrscr();
gotoxy(30,4);cout<<"MODIFY ENTRY";
gotoxy(5,7);cout<<"Flight Name:";gets(fname);
gotoxy(5,9);cout<<"Destination:";
gotoxy(25,9);cout<<"From:";cin>>destfrom;
gotoxy(45,9);cout<<"To:";cin>>dest_to;
gotoxy(5,11);cout<<"Day Of Journey:";cin>>day;
gotoxy(5,13);cout<<"Time:";
gotoxy(25,13);cout<<"Arrival:";cin>>arrival;
gotoxy(45,13);cout<<"Departure:";cin>>departure;
gotoxy(5,15);cout<<"No. Of Seats:";
gotoxy(25,15);cout<<"1st Class:";cin>>seats1;
gotoxy(45,15);cout<<"Economy Class:";cin>>seats2;
gotoxy(5,17);cout<<"Fare:";
gotoxy(25,17);cout<<"1st Class:";cin>>fare1;
19
gotoxy(45,17);cout<<"Economy Class:";cin>>fare2;
clrscr();
gotoxy(30,4);cout<<"DELETE ENTRY";
gotoxy(5,7);cout<<"Flight No.:";cout<<fno;
gotoxy(5,9);cout<<"Flight Name:";cout<<fname;
gotoxy(5,11);cout<<"Destination:";
gotoxy(25,11);cout<<"From:";cout<<destfrom;
gotoxy(45,11);cout<<"To:";cout<<dest_to;
gotoxy(5,13);cout<<"Day Of Journey:";cout<<day;
gotoxy(5,15);cout<<"Time:";
gotoxy(25,15);cout<<"Arrival:";cout<<arrival;
gotoxy(45,15);cout<<"Departure:";cout<<departure;
gotoxy(5,17);cout<<"No. Of Seats:";
gotoxy(25,17);cout<<"1st Class:";cout<<seats1;
gotoxy(45,17);cout<<"Economy Class:";cout<<seats2;
gotoxy(5,19);cout<<"Fare:";
gotoxy(25,19);cout<<"1st Class:";cout<<fare1;
gotoxy(45,19);cout<<"Economy Class:";cout<<fare2;
clrscr();
gotoxy(30,4);cout<<"VIEW ENTRY";
gotoxy(5,7);cout<<"Flight No.:";cout<<fno;
gotoxy(5,9);cout<<"Flight Name:";cout<<fname;
20
gotoxy(5,11);cout<<"Destination:";
gotoxy(25,11);cout<<"From:";cout<<destfrom;
gotoxy(45,11);cout<<"To:";cout<<dest_to;
gotoxy(5,13);cout<<"Day Of Journey:";cout<<day;
gotoxy(5,15);cout<<"Time:";
gotoxy(25,15);cout<<"Arrival;";cout<<arrival;
gotoxy(45,15);cout<<"Departure:";cout<<departure;
gotoxy(5,17);cout<<"No. Of Seats:";
gotoxy(25,17);cout<<"1st Class:";cout<<seats1;
gotoxy(45,17);cout<<"Economy Class:";cout<<seats2;
gotoxy(5,19);cout<<"Fare:";
gotoxy(25,19);cout<<"1st Class:";cout<<fare1;
gotoxy(45,19);cout<<"Economy Class:";cout<<fare2;
void add_fentry();
void modify_fentry();
void del_fentry();
void view_fentry();
void flight_main()
{int che;
do
do
clrscr();
gotoxy(18,5);cout<<"**********FIIGHT DETAILS**********";
gotoxy(25,7);cout<<"1.ADD ENTRY";
gotoxy(25,9);cout<<"2.MODIFY ENTRY";
21
gotoxy(25,11);cout<<"3.DELETE ENTRY";
gotoxy(25,13);cout<<"4.VIEW ENTRY";
gotoxy(43,17);cin>>che;
switch(che)
{case 1:{
add_fentry();
break;
case 2:{
modify_fentry();
break;
case 3:{
del_fentry();
break;
case 4:{
view_fentry();
break;
22
}
void add_fentry()
{fstream f;
f.open("flight2.dat",ios::app | ios::binary);
flight F;
if(!f)
exit(0);
F.add_entry();
f.close();
void modify_fentry()
{fstream f,f1;
f.open("flight2.dat",ios::in | ios::binary);
flight F;
if(!f)
exit(0);
f1.open("temp.dat",ios::out | ios::binary);
int flighto;
char ans;
cin>>flighto;
f.read((char*)&F,sizeof(F));
while(!f.eof())
23
{
f1.write((char*)&F,sizeof(F));
else
{F.view_entry();
cin>>ans;
if(ans=='Y' || ans=='y')
{F.modify_entry();
else
f1.write((char*)&F,sizeof(F));
}f.read((char*)&F,sizeof(F));
f.close();
f1.close();
remove("flight2.dat");
rename("temp.dat","flight2.dat");
void del_fentry()
{fstream f,f1;
f.open("flight2.dat",ios::in | ios::binary);
flight F;
if(!f)
exit(0);
f1.open("temp.dat",ios::out | ios::binary);
24
int flighto;
cin>>flighto;
char ans;
f.seekg(0);
f.read((char*)&F,sizeof(F));
while(!f.eof())
f1.write((char*)&F,sizeof(F));
else
{F.view_entry();
cin>>ans;
f1.write((char*)&F,sizeof(F));
}f.read((char*)&F,sizeof(F));
f.close();
f1.close();
remove("flight2.dat");
rename("temp.dat","flight2.dat");
void view_fentry()
{fstream f;
f.open("flight2.dat",ios::in | ios::binary);
flight F;
if(!f)
25
exit(0);
f.seekg(0,ios::beg);
f.read((char*)&F,sizeof(F));
while(!f.eof())
F.view_entry();
getch();
f.read((char*)&F,sizeof(F));
f.close();
void delhi();
void chennai();
void mumbai();
void lucknow();
void pune();
void hyderabad();
void aizawl();
void jaipur();
void enqury_main()
{int che;
do
do
clrscr();
26
gotoxy(20,3);cout<<"********** ENQURY **********";
gotoxy(25,5);cout<<"1.DELHI";
gotoxy(25,7);cout<<"2.CHENNAI";
gotoxy(25,9);cout<<"3.MUMBAI";
gotoxy(25,11);cout<<"4.LUCKNOW";
gotoxy(25,13);cout<<"5.PUNE";
gotoxy(25,15);cout<<"6.HYDERABAD";
gotoxy(25,17);cout<<"7.AIZAWL";
gotoxy(25,19);cout<<"8.JAIPUR";
gotoxy(43,23);cin>>che;
switch(che)
{case 1:{
delhi();
break;
case 2:{
chennai();
break;
case 3:{
mumbai();
break;
27
case 4:{
lucknow();
break;
case 5:{
pune();
break;
case 6:{
hyderabad();
break;
case 7:{
aizawl();
break;
case 8:{
jaipur();
break;
void delhi()
{clrscr();
28
gotoxy(5,11);cout<<"9W-902 08-55 DAILY 9W-922 19-55 DAILY";
getch();
void chennai()
{clrscr();
getch();
void mumbai()
{clrscr();
29
gotoxy(5,11);cout<<"9W-902 08-55 DAILY 9W-922 19-55 DAILY";
getch();
void lucknow()
{clrscr();
getch();
void pune()
{clrscr();
30
gotoxy(5,11);cout<<"9W-902 08-55 DAILY 9W-922 19-55 DAILY";
getch();
void hyderabad()
{clrscr();
getch();
void aizawl()
{clrscr();
31
gotoxy(5,11);cout<<"9W-902 08-55 DAILY 9W-922 19-55 DAILY";
getch();
void jaipur()
{clrscr();
getch();
class reserve
{private:
char name[20];
int age;
32
char sex;
char add[50];
int fno;
char fname[30];
char destfrom[30],dest_to[30];
char clas[10];
int seat;
float fare;
int tkno;
public:
void reservation();
void add_rentry();
void modify_rentry();
void view_rentry();
int retu()
{return tkno;
}; // CLASS DECLARATION
clrscr();
gotoxy(30,1);cout<<"ADD RESERVATION";
gotoxy(30,3);cout<<"PASSENGER DETAILS";
gotoxy(5,5);cout<<"Name:";gets(name);
gotoxy(5,6);cout<<"Age:";cin>>age;
gotoxy(5,7);cout<<"Contact Address:";gets(add);
33
gotoxy(5,8);cout<<"Contact Phone No:";cin>>phno;
gotoxy(30,10);cout<<"FLIGHT DETAILS";
gotoxy(5,12);cout<<"Flight No.:";cin>>fno;
gotoxy(5,14);cout<<"Destination:";
gotoxy(25,14);cout<<"From:";cin>>destfrom;
gotoxy(45,14);cout<<"To:";cin>>dest_to;
gotoxy(5,15);cout<<"Class of Flight:";cin>>clas;
gotoxy(5,16);cout<<"No. Of Seats:";cin>>seat;
gotoxy(5,17);cout<<"Fare:";cin>>fare;
gotoxy(5,18);cout<<"Ticket No:";cin>>tkno;
getch();
clrscr();
gotoxy(30,1);cout<<"MODIFY RESERVATION";
gotoxy(30,3);cout<<"PASSENGER DETAILS";
gotoxy(5,5);cout<<"Name:";gets(name);
gotoxy(5,6);cout<<"Age:";cin>>age;
gotoxy(5,7);cout<<"Contact Address:";cin>>add;
gotoxy(30,10);cout<<"FLIGHT DETAILS";
gotoxy(5,12);cout<<"Flight No.:";cin>>fno;
gotoxy(5,14);cout<<"Destination:";
gotoxy(25,14);cout<<"From:";cin>>destfrom;
gotoxy(45,14);cout<<"To:";cin>>dest_to;
gotoxy(5,15);cout<<"Class of Flight:";cin>>clas;
gotoxy(5,16);cout<<"No. Of Seats:";cin>>seat;
34
gotoxy(5,17);cout<<"Fare:";cin>>fare;
clrscr();
gotoxy(30,1);cout<<"VIEW RESERVATION";
gotoxy(30,3);cout<<"PASSENGER DETAILS";
gotoxy(5,5);cout<<"Name:";cout<<name;
gotoxy(5,6);cout<<"Age:";cout<<age;
gotoxy(5,7);cout<<"Contact Address:";cout<<add;
gotoxy(30,10);cout<<"FLIGHT DETAILS";
gotoxy(5,12);cout<<"Flight No.:";cout<<fno;
gotoxy(5,13);cout<<"Flight Name:";cout<<fname;
gotoxy(5,14);cout<<"Destination:";
gotoxy(25,14);cout<<"From:";cout<<destfrom;
gotoxy(45,14);cout<<"To:";cout<<dest_to;
gotoxy(5,15);cout<<"Class of Plane:";cout<<clas;
gotoxy(5,16);cout<<"No. Of Seats:";cout<<seat;
gotoxy(5,17);cout<<"Fare:";cout<<fare;
gotoxy(5,18);cout<<"Ticket No:";cout<<tkno;
void add_record();
void modify_record();
void view_record();
void reservation_main()
{int ch;
35
do
do
clrscr();
gotoxy(25,7);cout<<"1.ADD RESERVATION";
gotoxy(25,9);cout<<"2.MODIFY RESERVATION";
gotoxy(25,11);cout<<"3.VIEW RESERVATION";
gotoxy(43,15);cin>>ch;
switch(ch)
{case 1:{
add_record();
break;
case 2:{
modify_record();
break;
case 3:{
view_record();
break;
36
}while(ch>=1 && ch<=3);
void add_record()
{fstream f;
f.open("reserve1.dat",ios::app | ios::binary);
reserve R;
if(!f)
exit(0);
R.add_rentry();
f.close();
void modify_record()
{fstream f,f1;
f.open("reserve1.dat",ios::in | ios::binary);
reserve R;
if(!f)
exit(0);
f1.open("temp.dat",ios::out | ios::binary);
int ticno;
char ans;
37
cin>>ticno;
f.read((char*)&R,sizeof(R));
while(!f.eof())
f1.write((char*)&R,sizeof(R));
else
{R.view_rentry();
cin>>ans;
if(ans=='Y' || ans=='y')
{R.modify_rentry();
else
f1.write((char*)&R,sizeof(R));
f.read((char*)&R,sizeof(R));
f.close();
f1.close();
remove("reserve1.dat");
rename("temp.dat","reserve1.dat");
void view_record()
{fstream f;
f.open("reserve1.dat",ios::in | ios::binary);
reserve R;
if(!f)
38
{cout<<"\nFile not found\n";
exit(0);
f.seekg(0,ios::beg);
f.read((char*)&R,sizeof(R));
while(!f.eof())
R.view_rentry();
getch();
f.read((char*)&R,sizeof(R));
f.close();
void main()
{clrscr();
gotoxy(34,10);cout<<"WELCOME TO";
getch();
int ch;
do{
do{
clrscr();
gotoxy(25,5);cout<<"1.FLIGHT DETAILS";
gotoxy(25,7);cout<<"2.RESERVATION DETAILS";
gotoxy(25,9);cout<<"3.ENQURY";
gotoxy(25,11);cout<<"4.EXIT";
39
gotoxy(43,13);cin>>ch;
switch(ch)
case 1: { flight_main();
break; }
case 2: { reservation_main();
break; }
break; }
gotoxy(31,10);cout<<"FOR USING";
exit(0);
break;
OUTPUT
40
41
42
43
44
45
46
47
48
CERTIFICATE
49
50