文档介绍:源代码
#include <>
#include <>
#include <>
#include <>
double Cwage;
double Swage;
double Mwage;
int ID;
class Ddegree
{
protected:
int Num;
char Name[20];
char Sex[10];
int Borntime;
int Age;
int degree;
double Salary;
Ddegree *next;
public:
Ddegree(char ID,char *Ename,char *Esex,int Eborntime,int Edegree)
{
this->Num=ID;
strcpy(this->Name,Ename);
strcpy(this->Sex,Esex);
this->Borntime=Eborntime;
this->degree=Edegree;
}
void Getage()
{
Age=2009-Borntime;
}
virtual void Calcwage()=0;
virtual void Output()=0;
friend pany;
};
class Xxs:public Ddegree
{
private:
double Workload;
public:
Xxs(char ID,char *Ename,char *Esex,int Eborntime,int Edegree,double Eworkload):Ddegree(ID,Ename,Esex,Eborntime,Edegree)
{
this->Workload=Eworkload;
}
double GetWorkload()
{
return Workload;
}
void SetWorkload(double Amount)
{
this->Workload=Amount;
}
void Calcwage()
{
Salary=Cwage+Workload*20;
}
void Output()
{
Getage();
Calcwage();
cout<<Num<<"\t"<<Name<<"\t"<<Sex<<"\t"<<Borntime<<"年\t"<<Age<<"岁\t"<<"小学生\t"<<Salary<<endl;
}
};
class Czs:public Ddegree
{
private:
double Workload;
public:
Czs(char ID,char *Ename,char *Esex,int Eborntime,int Edegree,double Eworkload):Ddegree(ID,Ename,Esex,Eborntime,Edegree)
{
this->Workload=Eworkload;
}
double GetWorkload()
{
return Workload;
}
void SetWorkload(double Amount)
{
this->Workload=Amount;
}
void Calcwage()
{
Salary=Swage+Workload*20+1000;
}
void Output()
{
Getage();
Calcwage();
cout<<Num<<"\t"<<Name<<"\t"<<Sex<<"\t"<<Borntime<<"年\t"<<Age<<"岁\t"<<"初中生\t"<<Salary<<endl;
}
};
class Gzs:public Ddegree
{
private:
double Workload;
public:
Gzs(char ID,char *Ename,char *Esex,int Eborntime,int Edegree,double Eworkload):Ddegree(ID,Ename,Esex,Eborntime,E