#includeiomanip.h#includeiostream.h#includefstream.h#includestdlib.hclassEmploy//基类-雇员类{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;in;i++){if(s[i].getsnum()==num)salesvolume+=s[i].getsales();}returnsalesvolume;}};classTechnician:publicEmploy//技术员类{protected:intworktime;public:voidset();voidprint();voidreserved();};voidManager::set(){wage=8000;cout经理的编号:;cinnum;cout其姓名:;cinname;cout性别(m/w):;cinsex;cout年龄:;cinage;}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经理的编号:numendl其姓名:nameendl性别(m/w):sexendl年龄:ageendl;}voidMarketMan::set(){wage=resetwage();cout销售经理的编号:;cinnum;cout其姓名:;cinname;cout性别(m/w):;cinsex;cout年龄:;cinage;}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销售经理的编号:numendl其姓名:nameendl性别(m/w):sexendl年龄:ageendl;}intMarketMan::resetwage(){wage=5000+int(salesvolume*0.005);returnwage;}voidSalesman::set()//销售员类定义{cout销售员的编号:;cinnum;cout其姓名:;cinname;cout性别(m/w):;cinsex;cout年龄:;cinage;cout销售额:;cinsalesvolume;cout所属销售经理的编号:;cinsnum;wage=int(salesvolume*0.04);}voidSalesman::printinfor(){cout┣━━━━━━━╋━━━━━━━╋━━━━━━━┫endl;cout┃setw(14)num┃setw(14)name┃setw(14)salesvolume┃endl;}voidSalesman::print(){cout┣━━━━╋━━━━━╋━━━━━╋━━━━━╋━━━━━╋━━━━━━━━┫endl;cout┃setw(8)num┃setw(10)name┃setw(10)sex;cout┃setw(10)age┃setw(10)wage┃setw(16)getsnum()┃endl;}voidSalesman::reserved(){ofstreamemployf(E:\\05-29\\gzglxt.txt,ios::app);employf销售员的编号:numendl其姓名:nameendl性别(m/w):sexendl年龄:ageendl销售额:salesvolumeendl所属销售经理的编号snumendl;}voidTechnician::set()//技术员类定义{cout技术员的编号:;cinnum;cout其姓名:;cinname;cout性别(m/w):;cinsex;cout年龄:;cinage;cout工作时间:;cinworktime;wage=worktime*100;}voidTechnician::print(){cout┣━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━┫endl;cout┃setw(12)num┃setw(12)name┃setw(12)sex;cout┃setw(12)age┃setw(12)wage┃endl;}voidTechnician::reserved(){ofstreamemployf(E:\\05-29\\gzglxt.txt,ios::app);employf技术员的编号:numendl其姓名:nameendl性别(m/w):sexendl年龄:ageendl工作时间:worktimeendl;}//主函数intt,m,s,mm;Technician*pt;Manager*pm;Salesman*ps;MarketMan*pmm;voidsetin();voidcount();voidprintdata();voidreservedall();voidsingle();voidmain(){cout请分别输入技术员,经理,销售员,销售经理人数:endl;cintmsmm;pt=newTechnician[t];pm=newManager[m];ps=newSalesman[s];pmm=newMarketMan[mm];if((!pt)||(!pm)||(!ps)||(!pmm)){cout堆内存分配失败!endl;exit(1);}single();}voidsingle(){cout★★小型公司工资管理系统★★endl;cout┏━━━━━━━━━━━━━┓endl;cout┃请选择所需的操作┃endl;cout┃┃endl;cout┃数据输入:1,并按回车键┃endl;cout┃┃endl;cout┃数据统计:2,并按回车键┃endl;cout┃┃endl;cout┃数据打印:3,并按回车键┃endl;cout┃┃endl;cout┃数据备份:4,并按回车键┃endl;cout┃┃endl;cout┃退出系统:5,并按回车键┃endl;cout┃┃endl;cout┗━━━━━━━━━━━━━┛endl;cout请选择一个操作:endl;intchoice;cinchoice;switch(choice){case1:setin();case2:count();case3:printdata();case4:reservedall();case5:exit(0);}}voidsetin(){Menu1:cout★★小型公司工资管理系统★★endl;cout┏━━━━━━━━━━━━━━━━┓endl;cout┃请选择所需的操作┃endl;cout┃┃endl;cout┃技术员数据输入:1,并按回车键┃endl;cout┃┃endl;cout┃经理数据输入:2,并按回车键┃endl;cout┃┃endl;cout┃销售员数据输入:3,并按回车键┃endl;cout┃┃endl;cout┃销售经理数据输入:4,并按回车键┃endl;cout┃┃endl;cout┃返回上一级菜单:5,并按回车键┃endl;cout┗━━━━━━━━━━━━━━━━┛endl;cout请选择一个操作;intch1,i;cinch1;switch(ch1){case1:{for(i=0;it;i++)pt[i].set();cout---------------------------------endl;gotoMenu1;}case2:{for(i=0;im;i++)pm[i].set();cout---------------------------------endl;gotoMenu1;}case3:{for(i=0;is;i++)ps[i].set();cout---------------------------------endl;gotoMenu1;}case4:{for(i=0;imm;i++)pmm[i].set();cout---------------------------------endl;gotoMenu1;}case5:single();}}voidcount(){Menu2:cout★★小型公司工资管理系统★★endl;cout┏━━━━━━━━━━━━━━━━━━━━━━┓endl;cout┃请选择所需的操作┃endl;cout┃┃endl;cout┃各销售经理下属销售员业绩统计:1,并按回车键┃endl;cout┃┃endl;cout┃销售经