#include <iostream>
using namespace std;
class Person_0094
{
private:
string name;
int age;
int income;
protected:
string address;
void set_person(string na,int ag, int in, string ad)
{
name = na;
age = ag;
income = in;
address = ad;
}
string getperson_Name()
{
return name;
}
int getperson_Age()
{
return age;
}
int getperson_Income()
{
return income;
}
string getperson_Address()
{
return address;
}
public:
Person_0094(string na,int ag, int in, string ad)
{
set_person(na,ag, in, ad);
}
};
class JobHolder_0094 : public Person_0094
{
public:
string designation, organization;
JobHolder_0094(string na,int ag, int in, string ad, string des, string org):
Person_0094(na,ag, in, ad)
{
designation = des;
organization = org;
}
void display()
{
cout << "Name: " << getperson_Name() << endl;
cout << "Adress: " << getperson_Address() << endl;
cout << "Age: " << getperson_Age() << endl;
cout << "Income: " << getperson_Income() << endl;
cout << "Designation: " << designation << endl;
cout << "Organization: " << organization << endl;
}
};
class Businessman_0094 : public Person_0094
{
public:
string businessTitle;
Businessman_0094(string na,int ag, int in, string ad, string business_title):
Person_0094(na,ag, in, ad)
{
businessTitle = business_title;
}
void display()
{
cout << "Name: " << getperson_Name() << endl;
cout << "Adress: " << getperson_Address() << endl;
cout << "Age: " << getperson_Age() << endl;
cout << "Income: " << getperson_Income() << endl;
cout << "Business Title: " << businessTitle << endl;
}
};
int main()
{
int option;
int job=0;
int bus=0;
string name;
int age;
int income;
string address;
string designation;
string organization;
string businessTitle;
JobHolder_0094 *job_h[20];
Businessman_0094 *bus_t[20];
do
{
cout<<" *** Choose an Option ***\n";
cout<<"Enter Option 1 for Job-Holder"<<endl;
cout<<"Enter Option 2 for Businessman"<<endl;
cout<<"Enter Option 3 to Display Job-Holder"<<endl;
cout<<"Enter Option 4 to Display Businessman"<<endl;
cout<<"Enter Option 0 to Exit"<<endl;
cout<<"Enter Option:";
cin>> option;
if(option==1 || option==2)
{
cout<< "Enter Name:";
cin>> name;
cout<< "Enter Address:";
cin>> address;
cout<< "Enter Age:";
cin>> age;
cout<< "Enter Income:";
cin>> income;
if(option==1)
{
cout<<"Enter designation:";
cin>>designation;
cout<<"Enter organization:";
cin>>organization;
job_h[job] = new JobHolder_0094(name,age, income, address, designation, organization);
job++;
}
else
{
cout<<"Enter business title:";
cin>>businessTitle;
bus_t[bus] = new Businessman_0094(name,age, income, address, businessTitle);
bus++;
}
}
else if(option==3)
{
cout<<"*** All Job Holders ***\n\n\n\n";
for(int i=0; i<job; i++)
{
cout<<"Job-Holder Number: " << i+1 << endl;
job_h[i]->display();
}
}
else if(option==4)
{
cout<<"*** All Businessman ***\n\n\n\n";
for(int i=0; i<bus; i++)
{
cout<<"Businessman Number: " << i+1 << endl;
bus_t[i]->display();
}
}
}
while(option!=0);
return 0;
}#include <iostream>
using namespace std;
class Person_0094
{
private:
string name;
int age;
int income;
protected:
string address;
void set_person(string na,int ag, int in, string ad)
{
name = na;
age = ag;
income = in;
address = ad;
}
string getperson_Name()
{
return name;
}
int getperson_Age()
{
return age;
}
int getperson_Income()
{
return income;
}
string getperson_Address()
{
return address;
}
public:
Person_0094(string na,int ag, int in, string ad)
{
set_person(na,ag, in, ad);
}
};
class JobHolder_0094 : public Person_0094
{
public:
string designation, organization;
JobHolder_0094(string na,int ag, int in, string ad, string des, string org):
Person_0094(na,ag, in, ad)
{
designation = des;
organization = org;
}
void display()
{
cout << "Name: " << getperson_Name() << endl;
cout << "Adress: " << getperson_Address() << endl;
cout << "Age: " << getperson_Age() << endl;
cout << "Income: " << getperson_Income() << endl;
cout << "Designation: " << designation << endl;
cout << "Organization: " << organization << endl;
}
};
class Businessman_0094 : public Person_0094
{
public:
string businessTitle;
Businessman_0094(string na,int ag, int in, string ad, string business_title):
Person_0094(na,ag, in, ad)
{
businessTitle = business_title;
}
void display()
{
cout << "Name: " << getperson_Name() << endl;
cout << "Adress: " << getperson_Address() << endl;
cout << "Age: " << getperson_Age() << endl;
cout << "Income: " << getperson_Income() << endl;
cout << "Business Title: " << businessTitle << endl;
}
};
int main()
{
int option;
int job=0;
int bus=0;
string name;
int age;
int income;
string address;
string designation;
string organization;
string businessTitle;
JobHolder_0094 *job_h[20];
Businessman_0094 *bus_t[20];
do
{
cout<<" *** Choose an Option ***\n";
cout<<"Enter Option 1 for Job-Holder"<<endl;
cout<<"Enter Option 2 for Businessman"<<endl;
cout<<"Enter Option 3 to Display Job-Holder"<<endl;
cout<<"Enter Option 4 to Display Businessman"<<endl;
cout<<"Enter Option 0 to Exit"<<endl;
cout<<"Enter Option:";
cin>> option;
if(option==1 || option==2)
{
cout<< "Enter Name:";
cin>> name;
cout<< "Enter Address:";
cin>> address;
cout<< "Enter Age:";
cin>> age;
cout<< "Enter Income:";
cin>> income;
if(option==1)
{
cout<<"Enter designation:";
cin>>designation;
cout<<"Enter organization:";
cin>>organization;
job_h[job] = new JobHolder_0094(name,age, income, address, designation, organization);
job++;
}
else
{
cout<<"Enter business title:";
cin>>businessTitle;
bus_t[bus] = new Businessman_0094(name,age, income, address, businessTitle);
bus++;
}
}
else if(option==3)
{
cout<<"*** All Job Holders ***\n\n\n\n";
for(int i=0; i<job; i++)
{
cout<<"Job-Holder Number: " << i+1 << endl;
job_h[i]->display();
}
}
else if(option==4)
{
cout<<"*** All Businessman ***\n\n\n\n";
for(int i=0; i<bus; i++)
{
cout<<"Businessman Number: " << i+1 << endl;
bus_t[i]->display();
}
}
}
while(option!=0);
return 0;
}#include <iostream>
using namespace std;
class Person_0094
{
private:
string name;
int age;
int income;
protected:
string address;
void set_person(string na,int ag, int in, string ad)
{
name = na;
age = ag;
income = in;
address = ad;
}
string getperson_Name()
{
return name;
}
int getperson_Age()
{
return age;
}
int getperson_Income()
{
return income;
}
string getperson_Address()
{
return address;
}
public:
Person_0094(string na,int ag, int in, string ad)
{
set_person(na,ag, in, ad);
}
};
class JobHolder_0094 : public Person_0094
{
public:
string designation, organization;
JobHolder_0094(string na,int ag, int in, string ad, string des, string org):
Person_0094(na,ag, in, ad)
{
designation = des;
organization = org;
}
void display()
{
cout << "Name: " << getperson_Name() << endl;
cout << "Adress: " << getperson_Address() << endl;
cout << "Age: " << getperson_Age() << endl;
cout << "Income: " << getperson_Income() << endl;
cout << "Designation: " << designation << endl;
cout << "Organization: " << organization << endl;
}
};
class Businessman_0094 : public Person_0094
{
public:
string businessTitle;
Businessman_0094(string na,int ag, int in, string ad, string business_title):
Person_0094(na,ag, in, ad)
{
businessTitle = business_title;
}
void display()
{
cout << "Name: " << getperson_Name() << endl;
cout << "Adress: " << getperson_Address() << endl;
cout << "Age: " << getperson_Age() << endl;
cout << "Income: " << getperson_Income() << endl;
cout << "Business Title: " << businessTitle << endl;
}
};
int main()
{
int option;
int job=0;
int bus=0;
string name;
int age;
int income;
string address;
string designation;
string organization;
string businessTitle;
JobHolder_0094 *job_h[20];
Businessman_0094 *bus_t[20];
do
{
cout<<" *** Choose an Option ***\n";
cout<<"Enter Option 1 for Job-Holder"<<endl;
cout<<"Enter Option 2 for Businessman"<<endl;
cout<<"Enter Option 3 to Display Job-Holder"<<endl;
cout<<"Enter Option 4 to Display Businessman"<<endl;
cout<<"Enter Option 0 to Exit"<<endl;
cout<<"Enter Option:";
cin>> option;
if(option==1 || option==2)
{
cout<< "Enter Name:";
cin>> name;
cout<< "Enter Address:";
cin>> address;
cout<< "Enter Age:";
cin>> age;
cout<< "Enter Income:";
cin>> income;
if(option==1)
{
cout<<"Enter designation:";
cin>>designation;
cout<<"Enter organization:";
cin>>organization;
job_h[job] = new JobHolder_0094(name,age, income, address, designation, organization);
job++;
}
else
{
cout<<"Enter business title:";
cin>>businessTitle;
bus_t[bus] = new Businessman_0094(name,age, income, address, businessTitle);
bus++;
}
}
else if(option==3)
{
cout<<"*** All Job Holders ***\n\n\n\n";
for(int i=0; i<job; i++)
{
cout<<"Job-Holder Number: " << i+1 << endl;
job_h[i]->display();
}
}
else if(option==4)
{
cout<<"*** All Businessman ***\n\n\n\n";
for(int i=0; i<bus; i++)
{
cout<<"Businessman Number: " << i+1 << endl;
bus_t[i]->display();
}
}
}
while(option!=0);
return 0;
}