#include <iostream>
#include <string>
#define KOLVO 4
using namespace std;
class CPerson
{
public:
string Name;
string Family;
string Otchestvo;
//Функция
virtual void ShowData()
{}
//Конструктор умолчания
CPerson():Name("empty"),Family("empty"),Otchestvo("empty"){}
//Конструктор копирования
CPerson(const CPerson&A):Name(A.Name),Family(A.Family),Otchestvo(A.Otchestvo){}
CPerson(string a,string b, string c):Name(a),Family(b),Otchestvo(c){}
};
class CStudent: public CPerson
{
public:
int Ball;
//Конструкторы
CStudent():CPerson("empty1","empty1","empty1"),Ball(0){};
CStudent(const CStudent&A):CPerson(A.Name,A.Family,A.Otchestvo),Ball(A.Ball){}
CStudent(string a, string b, string c, int d):CPerson(a,b,c),Ball(d){}
//Функция
void ShowData()
{
cout<<"\nName "<<Name<<endl;
cout<<"Family "<<Family<<endl;
cout<<"Otchestvo "<<Otchestvo<<endl;
cout<<"Ball "<<Ball<<endl;
}
};
enum Dolzhn {prepod,upg_prepod,docent,prof};
class CProfessor: public CPerson
{
public:
int Chislo_publikac;
Dolzhn dol;
int age;
//Конструкторы
CProfessor():CPerson("empty1","empty1","empty1"),Chislo_publikac(0),dol(prepod),age(40){}
CProfessor(const CProfessor&A):CPerson(A.Name,A.Family,A.Otchestvo),Chislo_publikac(A.Chislo_publikac),
dol(A.dol),age(A.age){}
CProfessor(string a, string b, string c,int d, Dolzhn e, int f):CPerson(a,b,c),Chislo_publikac(d),dol(e),age(f){}
//Функция
void ShowData()
{
cout<<"\nName "<<Name<<endl;
cout<<"Family "<<Family<<endl;
cout<<"Otchestvo "<<Otchestvo<<endl;
cout<<"Chislo publicaciy "<<Chislo_publikac<<endl;
cout<<"Dolzhnost' "<<dol<<endl;
cout<<"Vozrast "<<age<<endl;if(age>150){cout<<"FIGASEBE!!!)))";}
}
};
int main()
{
CPerson* mas[KOLVO];
CStudent Pers1;
CProfessor Pers2;
for (int i = 0;i < KOLVO; i++)
{
cout<<"Stud.Imya\n";cin>>Pers1.Name;
cout<<"Familia\n";cin>>Pers1.Family;
cout<<"Otchestvo\n";cin>>Pers1.Otchestvo;
cout<<"Ball\n";cin>>Pers1.Ball;
mas[i]= new CStudent(Pers1);
i++;
if(i<KOLVO)
{
cout<<"Prof.Imya\n";cin>>Pers2.Name;
cout<<"Familia\n";cin>>Pers2.Family;
cout<<"Otchestvo\n";cin>>Pers2.Otchestvo;
cout<<"Chislo publikaciy\n";cin>>Pers2.Chislo_publikac;
int pre;
cout<<"Dolzhnost. 1(prepod),2(upg_prepod),3(docent) ili 4(prof)\n";cin>>pre;
switch(pre)
{case 1:Pers2.dol=prepod;break;
case 2:Pers2.dol=upg_prepod;break;
case 3:Pers2.dol=docent;break;
case 4:Pers2.dol=prof;break;
default:cout<<"Vu oshiblis'\n";break;}
cout<<"Vozrast\n";cin>>Pers2.age;
mas[i]= new CProfessor(Pers2);
}
else
{break;}
}
for(int i=0;i<KOLVO;i++)
{mas[i]->ShowData();}
for(int i=0;i<KOLVO;i++)
{delete mas[i];}
cin.get();
cin.get();
return 0;
}