#include<iostream.h>
#include<conio.h>
class flight
{
private:
char flight_name[15];
int flight_no;
char source[15];
char destination[15];
public:
void readdata()
{
cout<< "Flight Name : ";
cin >>flight_name;
cout<< "Flight Number : ";
cin >>flight_no;
cout<< "Source : ";
cin >>source;
cout<< "Destination : ";
cin >>destination;
}
void writedata()
{
cout<< "Flight Name : "<<flight_name<<endl;
cout<< "Flight Number : "<<flight_no<<endl;
cout<< "Source : "<<source<<endl;
cout<< "Destination : "<<destination<<endl;
}
};
void main()
{
clrscr();
flight flight_domestic[10];
int n,i;
cout<<"Enter the Total Number of Flight "<<endl;
cin >> n;
for(i=0;i<n;i++)
{
cout<< "Enter Data for Flight : "<<i+1<<endl;
flight_domestic[i].readdata();
}
cout << "Flight Data Details "<<endl;
for(i=0;i<n;i++)
{
flight_domestic[i].writedata();
getch();
}
}