Академический Документы
Профессиональный Документы
Культура Документы
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");
}
2. Entering files
3. Show flights
4. Search flights
5. Delete flights
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.
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