预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共19页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

#include<iomanip.h>#include<iostream.h>#include<fstream.h>#include<stdlib.h>classEmploy//基类-雇员类{protected:intnum;charname[10];charsex;intage;intwage;public:virtualvoidset()=0;virtualvoidprint()=0;virtualvoidreserved()=0;};classManager:publicEmploy//经理类{public:voidset();voidprint();voidreserved();};classSalesman:publicEmploy//销售员类{protected:intsalesvolume;intsnum;public:voidset();voidprint();voidreserved();voidprintinfor();intgetsales(){returnsalesvolume;}intgetsnum(){returnsnum;}};classMarketMan:publicManager//销售经理类{protected:intsalesvolume;public:voidset();voidprint();voidreserved();intresetwage();intgetnum(){returnnum;}char*getname(){returnname;}intgetamount(Salesmans[],intn){salesvolume=0;for(inti=0;i<n;i++){if(s[i].getsnum()==num)salesvolume+=s[i].getsales();}returnsalesvolume;}};classTechnician:publicEmploy//技术员类{protected:intworktime;public:voidset();voidprint();voidreserved();};voidManager::set(){wage=8000;cout<<"经理旳编号:";cin>>num;cout<<"其姓名:";cin>>name;cout<<"性别(m/w):";cin>>sex;cout<<"年龄:";cin>>age;}voidManager::print()//经理类组员函数{cout<<"┣━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━┫"<<endl;cout<<"┃"<<setw(12)<<num<<"┃"<<setw(12)<<name<<"┃"<<setw(12)<<sex;cout<<"┃"<<setw(12)<<age<<"┃"<<setw(12)<<wage<<"┃"<<endl;}voidManager::reserved(){ofstreamemployf("E:\\05-29\\gzglxt.txt",ios::app);employf<<"经理旳编号:"<<num<<endl<<"其姓名:"<<name<<endl<<"性别(m/w):"<<sex<<endl<<"年龄:"<<age<<endl;}voidMarketMan::set(){wage=resetwage();cout<<"销售经理旳编号:";cin>>num;cout<<"其姓名:";cin>>name;cout<<"性别(m/w):";cin>>sex;cout<<"年龄:";cin>>age;}voidMarketMan::print(){resetwage();cout<<"┣━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━┫"<<endl;cout<<"┃"<<setw(12)<<num<<"┃"<<setw(12)<<name<<"┃"<<setw(12)<<sex;cout<<"┃"<<setw(12)<<age<<"┃"<<setw(12)<<wage<<"┃"<<endl;}voidMarketMan::reserved(){ofstreamemployf("E:\\05-29\\gzglxt.txt",ios::app);employf<<"销售经理旳编号:"<<num<<endl<<"其姓名:"<<name<<endl<<"性别(m/w):"<<sex<<endl<<"年龄:"<<age<<endl;}intMarketMan::resetwage(){wage=5000+int(salesvolume*0.005);returnwage;}voidSalesman::set()//销售