资源预览内容
第1页 / 共12页
第2页 / 共12页
第3页 / 共12页
第4页 / 共12页
第5页 / 共12页
第6页 / 共12页
第7页 / 共12页
第8页 / 共12页
第9页 / 共12页
第10页 / 共12页
亲,该文档总共12页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
includeiomanip.h#includeiostream。hincludeincludestdlib.hclass Employ/基类雇员类protected: int num; char name10; char sex; int age; int wage;public:virtual void set()=0;virtual void print()=0;virtual void reserved()=0;class Manager:public Employ/经理类public: void set(); void print();void reserved();;class Salesman:public Employ/销售员类protected:int salesvolume;int snum;public: void set(); void print();void reserved();void printinfor();int getsales()return salesvolume;int getsnum()return snum;;class MarketMan:public Manager/销售经理类protected:int salesvolume;public: void set(); void print();void reserved(); int resetwage();int getnum()return num;chargetname()return name;int getamount(Salesman s,int n)salesvolume=0;for(int i=0;in;i+)if(si。getsnum()=num)salesvolume+=si.getsales();return salesvolume;;class Technician:public Employ/技术员类protected:int worktime;public: void set(); void print();void reserved();;void Manager::set()wage=8000;coutnum;coutname;coutsex;cout年龄:”;cinage;void Manager::print()/经理类成员函数coutendl;coutsetw(12)num”setw(12)name”setw(12)sex;cout”setw(12)age”setw(12)wage”endl;void Manager::reserved()ofstream employf(E:0529gzglxt。txt”,ios:app);employf经理的编号:numendl ”其姓名:nameendl ”性别(m/w):sexendl 年龄:”ageendl;void MarketMan::set()wage=resetwage();coutnum;coutname;coutsex;cout”年龄:;cinage; void MarketMan:print() resetwage();cout”endl;coutsetw(12)numsetw(12)name”setw(12)sex;cout”setw(12)age”setw(12)wage”endl;void MarketMan::reserved() ofstream employf(E:0529gzglxt.txt”,ios:app);employf销售经理的编号:numendl ”其姓名:”nameendl 性别(m/w):”sexendl ”年龄:ageendl;int MarketMan:resetwage()wage=5000+int(salesvolume*0。005);return wage;void Salesman::set()/销售员类定义coutnum;coutname;cout”性别(m/w):;cinsex;coutage;cout”销售额:”;cinsalesvolume;coutsnum; wage=int(salesvolume*0。04);void Salesman:printinfor()cout”endl;cout”setw(14)num”setw(14)name”setw(14)salesvolumeendl;void Salesman::print()cout”endl;cout”setw(8)num”setw(10)namesetw(10)sex;coutsetw(10)age”setw(10)wage”setw(16)getsnum()”endl; void Salesman::reserved()ofstream employf(E:05-29gzglxt.txt”,ios:app);employf”销售员的编号:numendl ”其姓名:nameendl ”性别(m/w):sexendl 年龄:ageendl ”销售额:salesvolumeendl 所属销售经理的编号snumendl;void Technician:set()/技术员类定义coutnum;coutname;coutsex;cout年龄:”;cinage;coutworktime;wage=worktime*100; void Technician:print()cout”endl;coutsetw(12)num”setw(12)name”setw(12)sex;coutsetw(12)age”setw(12)wageendl; void Technician:reserved() ofstream employf(”E:05-29gzglxt.txt,ios::app);employf技术员的编号:”numendl ”其姓名:”nameendl 性别(m/w):sexendl ”年龄:”ageendl ”工作时间:worktimeendl;/主函数int t,m,s,mm;Technicianpt;Managerpm;Salesman*ps;MarketManpmm;void setin();void count();void printdata();void reservedall();void single();void main()cout请分别输入技术员,经理,销售员,销售经理人数:”tmsmm;pt=new Techniciant;pm=new Managerm;ps=new Salesmans;pmm=new MarketManmm;if((!pt)|(!pm)|(!ps)(!pmm)cout”堆内存分配失败!endl;exit(1);single();void single() 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
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号