#include<iostream>
#include<string>
using namespace std;
//Defining Base Class
class seat_type_booking{
public:
string seat_type;
int seat_type_choice;
//Defining a Constructor
seat_type_booking(){
cout<<"Enter your choice:";
cin>>seat_type_choice;
find_seat_type(seat_type_choice);
cout<<"You have selected "<<seat_type<<"\n";
}
//Defining A Method Function
void find_seat_type(int a){
seat_type=(seat_type_choice==1?"Economy":"Business");
}
};
//Defining Derived CLass
class seat_position_selection:public seat_type_booking{
public:
string seat_position;
int seat_position_choice;
seat_position_selection(){
cout<<"1. Window\n2. Corner\n3. Middle\n";
cout<<"Enter your choice:";
cin>>seat_position_choice;
find_seat_position(seat_position_choice);
cout<<"You have successfully choosen "<<seat_position<<"seat\n";
}
void find_seat_position(int seat_position_choice){
if(seat_position_choice==1){
seat_position="Window";
}
else if(seat_position_choice==2){
seat_position="Corner";
}
else{
seat_position="Middle";
}
}
};
int main(){
cout<<"\nImplementation Of Single Inheritance In Airline Travel Management\n";
cout<<"1. Economy\n2. Business\n";
seat_position_selection();
return 0;
}