void getdata()
{
cin.ignore();
cout<<"Enter the name of passenger: ";
cin.getline(name,60);
cout<<endl<<endl;
cout<<"Enter address of passenger: ";
cin.getline(address,60);
cout<<endl<<endl;
cout<<"Enter the current location of passenger: ";
cin.getline(c_loc,60);
cout<<endl<<endl;
cout<<"Enter the destination of passenger: ";
cin.getline(dest,60);
cout<<endl<<endl;
}
void show()
{
cout<<"Passenger name is:"<<setw(4)<<name<<endl;
cout<<"Address of passenger is:"<<setw(4)<<address<<endl;
cout<<"Current location of passenger is:"<<setw(4)<<c_loc<<endl;
cout<<"Destination of passenger is:"<<setw(4)<<dest<<endl;
cout<<endl<<endl;
}
};
class booking:public passenger
{
protected:
int num;
public:
void getdata()
{
cout<<"How many bookings you want to make?"<<endl;
cin>>num;
for(int i=0;i<num;i++)
{
cout<<"Please enter the required information for passenger number:"<<i+1<<endl;
passenger::getdata();
system("CLS");
}
}
void show()
{
for(int j=0;j<num;j++)
{
cout<<"Following is some information about passenger number:"<<j+1<<endl;
passenger::show();
}
}
t=0;
cout<<setw(10)<<"FOLLOWING ARE THE INTERNATIONAL FLIGHTS AVAILABLE"<<endl;
for(int i=0;i<5;i++)
{
t++;
for(int j=0;j<10;j++)
{
cout<<"FLIGHT FROM "<<l_destination[i]<<" TO "<<i_destination[j]<<" IS AT "<<t+1<<"00 HRS"<<endl;
t++;
}
}
cout<<setw(10)<<"FOLLOWING ARE THE LOCAL FLIGHTS AVAILABLE"<<endl;
cout<<"FLIGHT FROM "<<l_destination[x]<<" TO "<<l_destination[y+1]<<" IS AT:"<<t<<"00 HRS"<<endl;
t+2;
cout<<"FLIGHT FROM "<<l_destination[y+1]<<" TO "<<l_destination[x]<<" IS AT:"<<t<<"00 HRS"<<endl;
}
}
}
friend class local;
friend class international;
};
class local:public booking
{
protected:
int b_seat;
int e_seat;
int ch;
public:
void travel(search s)
{
cout<<"THESE ARE THE LOCAL PLACES AVAILABLE"<<endl;
for(int i=0;i<4;i++)
{
cout<<s.l_destination[i]<<endl;////////////////////////////////////////////////////////here is the error
}
booking::getdata();
for(int j=0;j<4;j++)
{
if(strcmp(s.l_destination[j],dest)==0 &&strcmp(s.l_destination[j],c_loc)==0)
cout<<"FLIGHT AVAILABLE ON THIS ROUTE";
}
b_seat=30;
e_seat=40;
cout<<setw(20)<<"In which class you want to travel? Make your choice"<<endl<<endl;
cout<<"Press 1 for buisness class"<<endl;
cout<<"Press 2 for economy class"<<endl;
cout<<"Enter your choice"<<endl;
cin>>ch;
cout<<endl;
switch(ch)
{
case 1:
b_seat--;
if(b_seat<=0)
cout<<"SORRY NO SEAT AVAILABLE"<<endl;
else
cout<<"SEAT AVAILABLE"<<endl;
break;
case 2:
e_seat--;
if(e_seat<=0)
cout<<"SORRY NO SEAT AVAILABLE"<<endl;
else
cout<<"SEAT AVAILABLE"<<endl;
break;
}
}
void show()
{
booking::show();
if(ch==1)
{
cout<<"YOUR TRAVELLING CLASS IS BUISNESS"<<endl;
}
if(ch==2)
{
cout<<"YOUR TRAVELLING CLASS IS ECONOMY"<<endl;
}