You are on page 1of 2

#include<iostream>

#include<string>
using namespace std;

class customers{

public:
string name;
int age;
int cost=2500;
int y;

customers(){
cout<<"Enter your name:";
cin>>name;
cout<<"Enter age:";
cin>>age;
//calculate_fee();
}

void calculate_fee();
};

class corporate_customer:public customers{


public:

corporate_customer(){
calculate_fee();
//cout<<"You have to pay "<<y;
}

void calculate_fee(){
cost=0.5*2500;
cout<<"You have to pay "<<cost;
}
};

class privilege_customer:public customers{


public:

privilege_customer(){
calculate_fee();
//cout<<"You have to pay "<<y;
}

void calculate_fee(){
cost=0.4*2500;
cout<<"You have to pay "<<cost;
}
};

int main(){
cout<<"Implementation of Hierarchical Inheritance In Airline Travel Management
System\n";
int choice;
cout<<"\n1. Corporate\n2. Previleage\n";
cout<<"Enter the choice:";
cin>>choice;
if(choice==1){
corporate_customer c1;
}
else{
privilege_customer p1;
}

return 0;
}

You might also like