Professional Documents
Culture Documents
Multiple Inheritance
Multiple Inheritance
#include<string>
using namespace std;
public:
string seat_type;
int seat_cost;
int seat_choice;
//Defining Constructor
seat(){
cout<<"\n1. Economy:1500\n2. Business:4000\n";
cout<<"Enter your choice:";
cin>>seat_choice;
find_seat_cost();
}
void find_seat_cost(){
seat_cost=(seat_choice==1?1500:4000);
}
};
public:
string meal_type;
int meal_cost;
int meal_choice;
meal(){
cout<<"\n1. Veg:200\n2. Non-Veg:400\n";
cout<<"Enter your choice:";
cin>>meal_choice;
find_meal_cost();
}
void find_meal_cost(){
meal_cost=(meal_choice==1?200:400);
}
};
public:
int total_cost;
total(){
find_total();
}
void find_total(){
total_cost=seat_cost+meal_cost;
}
void display(){
cout<<"Total Cost: "<<total_cost;
}
};
int main(){
cout<<"Implementation of Multiple Inheritance In Airline Travel Management
System\n";
total t;
t.display();
return 0;
}