文档介绍:#include<>
#include<>
#include<>
#include<>
#include<>
#include<>
static int m;
static int n;
static int p;
static int q;
static int r;
static int u;
static int v;
static int w;
static char PFS[16]="iamaboy";
static char PFS1[16]="iamagirl";
static char PFS2[16]="iamnotaboy";
/****************************
**基类CEmployee:
*****************************/
class CEmployee
{
public:
CEmployee()
{
Salary=;
}
void Get_Zname();
void Get_Name();
void Get_Number();
void Get_Sex();
void Get_Age();
void show();
virtual void input();
virtual void pay();
virtual void save()=0;
public:
char *Zname;
char *Name;
char Sex;
int Age;
int Number;
double Salary;
int Pming;
};
void CEmployee::Get_Number()
{
int id;
do
{
cout<<" 工号: ";
cin>>id;
if(id>1135||id<1101)
cout<<"请输入正确的工号(1101~1135)!!"<<endl<<endl;
}while (id<1101||id>1135);
Number=id;
}
void CEmployee::Get_Name()
{
char a[20];
do
{
Name=new char[strlen(a)+1];
cout<<" 姓名: ";
cin>>a;
if( strlen(a)>20 || strlen(a)<4 )
cout<<"请输入一个标准的姓名(4~20个连续的字符)!!"<<endl<<endl;
}while ( strlen(a)>20||strlen(a)<4 );
strcpy(Name,a);
}
void CEmployee::Get_Sex()
{
char c;
cout<<" 性别(m/f):" ;
cin>>c;
while (c!='m' && c!='f')
{
cout<<"您输入的信息有误。请查下后重新输入!!"<<endl<<endl;
cout<<" 性别(m/f):";
cin>>c;
}
Sex=c;
}
void CEmployee::Get_Age()
{
int d;
do
{
cout<<" 年龄: ";
cin>>d;
if(d>60||d<16)
cout<<"年龄不合法!!"<<endl<<endl;
}while (d<16||d>60);
Age=d;
}
void CEmployee::Get_Zname()
{
char b[40];
do{
Zname=new char[strlen(b)+1];
cout<<" 职称: ";
cin>>b;
if( strlen(b)>40 || strlen(b)<4)
cout<<"请输入正确的职称(4~40个连续的字符!)!!"<<endl<<endl;
}while ( strlen(b)>40||strlen(b)<4);
strcpy(Zname,b);
}
void CEmployee::input()
{
Get_Number();
Get_Name();
Get_Sex();
Get_Age();
Get_Zname();
cout<<endl;
}
void CEmployee::pay()
{
//