You are on page 1of 16

A PROJECT ON

FLIGHT MANAGEMENT SYSTEM

SUBMITTED BY: NIKHIL SACHDEVA


CLASS:XII-A
UNDER THE GUIDANCE OF
MRS. SHALINI BHATNAGAR
(PGT COMPUTER SCIENCE)
CERTIFICATE
this is to certify that Nikhil Sachdeva has completed his
project on the topic “Flight Handling for employees”
under my supervision.

I certify that it is his original work.

MRS SHALINI BHATNAGAR


(PGT COMPUTER SCIENCE)
ACKNOWLEDGEMENT
It gives me great pleasure to express my gratitude
towards our Computer Science teacher Mrs Shalini
Bhatnagar for her guidance, support and
encourangement throughout the duration pf the project.
Without her motivation and help the successful
completion of this project would not have been
possible.

Nikhil Sachdeva
CONTENTS

1. INTRODUCTION
2. SOURCE CODE
3. OUTPUT SCREENS
4. ADVANTAGES
5. DISADVANTAGES
6. CONCLUSION
7. BIBLIOGRAPHY
INTRODUCTION
‘Flyways Airways’ is an application software which helps
airline employees to handle flight data through one single file-
handling based program. It makes the job of the employee
easier and reliable. The data stored is safe and large amount of
data can be stored. It will make the flight handling system
efficient, less time-taking and almost error-less. Various
highlights of program are:
1. Enter flights: Flight details like flight number, departure
place, arrival place, departure time, arrival time can be
entered easily.
2. Show flights: This option lets the user see all the flights
available
3. Search flights: Flights in database can be searched
through flight number
4. Delete flights : Flights once entered can also be deleted
in this program through this feature.
5. Modify flights : Flight details that are wrongly entered
can be modified and those entered right can be retained
SOURCE CODE
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<iomanip.h>
#include<fstream.h>
#include<process.h>
#include<stdio.h>
class flight{ //class containing details of flights
int flno; //private members
char from[20];
char to[20];
int dtime;
int atime;
public: //public functions
int flightno(){return flno;} ;
void getdata()
{cout<<"Enter flight no. \n"; cin>>flno;
cout<<"Departure Place\n"; gets(from);
cout<<"Destination Place\n" ; gets(to);
cout<<"Departure Time\n"; cin>>dtime;
cout<<"Arrival Time\n" ; cin>>atime;
}
void showdata ()
{cout<<"\n\n\nFlight : "<<flno;
cout<<"\nDeparture Place : "<<from;
cout<<"\nDestination Place : "<<to;
cout<<"\nDeparture Time : "<<dtime;
cout<<"\nArrival Time : "<<atime;
}
int filno()
{return flno;}
void searchfile(); //function definitions
void writefile();
void readfile();
void deletefile();
void modify();
}a;

void main()
{clrscr();
int op=0;
while (op<=5)
{clrscr(); //menu for option selection
cout<<"\t\t\t\t\\\\\\\\\ Flyways Airways\\\\\\\\ \n\n";
cout<<"Select option:";
cout<<"\n\n 1. Enter a flight";
cout<<"\n 2. Show flights";
cout<<"\n 3. Search flights" ;
cout<<"\n 4. Delete flights" ;
cout<<"\n 5. Modify flight" ;
cout<<"\n 6. Exit \n";
cin>>op;
if (op==1)
{clrscr();
a.writefile(); }
if (op==2)
{clrscr();
cout<<"\nFlight available currently are:\n\n" ;
a.readfile();}
getch();
if (op==3)
{clrscr();
a.searchfile();
getch();
}
if (op==4)
{clrscr();
a.deletefile();
getch();
}
if (op==5)
{clrscr();
a.modify();}
}}
void flight::writefile() //function to write file
{
ofstream f;
f.open("flc.dat", ios::out|ios::app|ios::binary) ;
a.getdata();
f.write((char*) &a, sizeof (a));
f.close();
}
void flight::readfile() //function to read file
{
ifstream f;
f.open("flc.dat", ios::in|ios::binary) ;
while (f.read((char*) &a, sizeof(a)))
{
a.showdata();}getch();
f.close();}
void flight::searchfile() //function to search file
{
int sn,b;
ifstream f("flc.dat",ios::in);
cout<<"Enter Flight no to be searched for";
cin>>sn;
while(f.read((char*) &a, sizeof(a)))
{if (a.flightno()==sn)
{cout<<"\n\nFlight found successfully!!!!";
a.showdata();
}}}
void flight ::deletefile() //function to delete file
{ int fln;char ch;
fstream f("flc.dat",ios::in) ;
fstream file("temp.dat",ios::out);
cout<<"Enter flight no to be deleted" ;
cin>>fln;
while(f.read((char*) &a, sizeof(a)))
{if (a.filno()==fln)
{a.showdata();
cout<<"Are you sure you want to delete this flight? (y/n)";cin>>ch;
if (ch=='n')
file.write((char*) &a,sizeof(a));
}
else file.write((char*) &a,sizeof(a));
}
file.close();
f.close();
remove("flc.dat")
rename("temp.dat","flc.dat");
}

void flight::modify() //function to modify flight


{ fstream f("flc.dat",ios::in|ios::out|ios::binary);
int fln;
long pos;
char fr[20],tr[20] ;
int at,dt;
cout<<"Enter flight no. of flight to be modified";cin>>fln;
while (!f.eof())
{pos=f.tellg();
f.read((char*) &a, sizeof(a));
if (a.filno()==fln)
{a.showdata();
cout<<"Enter '.' if you want to retain the old one";
cout<<"\n\nEnter New Departure Place"; gets(fr);
cout<<"\nEnter New Destination Place"; gets(tr);
cout<<"\n\n Enter -1 to retain old one";
cout<<"\nEnter New Departure Time"; cin>>dt;
cout<<"\nEnter New Arrival Time"; cin>>at;
if (strcmp(fr,".")!=0)
strcpy(from,fr);
if (strcmp(tr,".")!=0)
strcpy(to,tr);
if (dt!=-1 )
dtime=dt;
if (at!=-1)
atime=at;
}
f.seekg(pos);
f.write((char*) &a, sizeof(a));
}}
OUTPUT SCREENS
1. Main Screen

2. Entering files
3. Show flights

4. Search flights
5. Delete flights

6. Modify existing flights


ADVANTAGES
 Flight data can be entered, seen and searched.
 Flight data can be deleted and modified too.
 Program uses concepts of arrays and file handling.
 Program is highly efficient over manually handling details.
 Stores details of flights in files stored in system.
 All the flights available can be seen at once and can be searched
through flight no.

DISADVANTAGES
 Program is single-user based.
 Data is stored on system and not on network.
 Since data is entered manually, handling data is hectic.
 Maintaining huge data without errors is a tough task
 Manual data entering is not error-less and hence it is not feasible
System Requirements
Hardware
An Intel based central processing unit capable of running
a n y s o r t o f windows operating system such as Pentium based
workstation.

 Minimum 64 MB RAM (128 MB Desirable) at server.


 Minimum 60 MB of free disk space for files.
 A CD Rom drive
Minimum 48 MB of RAM at workstation.
 VGA 15” color monitor for workstation.

Software
The software requirements are as follows.
 Windows 98 or Above
 C editor
 Microsoft word
CONCLUSION
The program is certainly a better way to store and
handle flight details over the manual data storing.
Its features like data entering, searching for flights,
deleting flights and modifying data makes it a
dynamic and efficient program.
It also has its disadvantages mentioned above but
this very program can be used for enhancing and
making it more efficient which can actually be
used for an airline.
BIBLIOGRAPHY

 COMPUTER SCIENCE WITH C++ BY SUMITA ARORA


 TUTORIALS ON http://youtube.com
 http://cppforschool.com

You might also like