1、 void inputAllowance(float i); float getMedicalInsurance() return medicalInsurance; void inputMedicalInsurance(float m); double getOverTimePay() return overTimePay; void inputOverTimePay(double o);void Profession:inputRank(char c) rank=c;inputAllowance(float i) allowance=i;inputBasicSalary(float b)
2、basicSalary=b;inputMedicalInsurance(float m) medicalInsurance=m;inputOverTimePay(double o) overTimePay=o;/*class Letter string letter; string getL() return letter;*/class Worker: public Profession/员工 string name,profession,letter; int ID; double wages;/税后工资 double salary;/税前工资 double totalWorkingtim
3、e;/总工时 char person;/态度 /等级 int personalPassword;/个人密码 int rankflag;/升级标志 int letterflag;/信件 int moneyflag;/加薪标志 Worker(int x=0,int y=0,int z=0):rankflag(x),letterflag(y),moneyflag(z) string getName() return name; void inputName(string n); int getID() return ID; void inputID(int i); string getProfess
4、ion() return profession; void inputProfession(string p); void getLetter() cout5000) wages=salary-salary*0.5; else if(salary1000&salary=5000) wages=salary-salary*0.3;evaluation() if(totalWorkingtime=30&totalWorkingtime60)C=60&90)B=90)AoutPut()/数出 cout姓名setw(8)ID职业基本工资津贴医保总工时工作评价工资endl;getName()IDprof
5、essiongetBasicSalary()getAllowance()getMedicalInsurance()reTotalworkingtime()getPerson()getWages()Congratulation()/祝贺 if(rankflag=1)恭喜您升职了 rankflag=0; else if(moneyflag=1)恭喜您加薪了 moneyflag=0; calculateSalary(); cout您现在薪水为wages nemberOfopinions+; letterflag=1;check(Worker *head)/ Worker *clerk=head-ne
6、xt; int id; char s; string d;输入您的IDid; if(clerk!=NULL&id=(*clerk).getID() (*clerk).Congratulation(); if(Bossflag=1) cout有信件 (*clerk).getLetter(); Bossflag=0; (*clerk).outPut();是否提出申请 couts; if(s=y) input: cind; (*clerk).opinion(); changeRank(char r,Worker *clerk)/等级 Profession a(a,8000,2000,200,300)
7、,b(b,7000,1500,150,200),c(c,6000,1000,100,100),d(d,3000,500,50,70); if(r=) (*clerk).inputRank(a.getRank(); (*clerk).inputBasicSalary(a.getBasicSalary(); (*clerk).inputMedicalInsurance(a.getMedicalInsurance(); (*clerk).inputAllowance(a.getAllowance(); (*clerk).inputOverTimePay(a.getOverTimePay(); els
8、e if(r= (*clerk).inputRank(b.getRank(); (*clerk).inputBasicSalary(b.getBasicSalary(); (*clerk).inputMedicalInsurance(b.getMedicalInsurance(); (*clerk).inputAllowance(b.getAllowance(); (*clerk).inputOverTimePay(b.getOverTimePay(); (*clerk).inputRank(c.getRank(); (*clerk).inputBasicSalary(c.getBasicSa
9、lary(); (*clerk).inputMedicalInsurance(c.getMedicalInsurance(); (*clerk).inputAllowance(c.getAllowance(); (*clerk).inputOverTimePay(c.getOverTimePay(); (*clerk).inputRank(d.getRank(); (*clerk).inputBasicSalary(d.getBasicSalary(); (*clerk).inputMedicalInsurance(d.getMedicalInsurance(); (*clerk).input
10、Allowance(d.getAllowance(); (*clerk).inputOverTimePay(d.getOverTimePay();class Boss void employed(Worker *head);/录用 void fire(Worker *head);/踢人 void changeWages(Worker *head);/加薪 void wokersApply(Worker *head);/职工建议 void CheckThesalary(Worker *head);/查看 void promotion(Worker *head); /升职void Boss:emp
11、loyed(Worker *head)fire(Worker *head)输入姓名 string name1; Worker *clerk=head-想踢谁? cinname1; doname1=(*clerk).getName() id=(*clerk).getID(); if(*clerk).getPerson()=)|(*clerk).getPerson()=)该员工评价B级以上,真的要解雇他? char a;a; if(a= Worker *p,*q; q=head; totalPay=totalPay-(*clerk).getSalary(); while(q-next!q-next
12、-getID()!=id) q=q- if(q-=NULL) p=q- q-next=q- count-;.成功删除! /加入主菜单 else Worker *p,*q; clerk=clerk- while(clerk!=NULL);changeWages(Worker *head) string c; char d; int flag=0;c; do do if(clerk!(*clerk).getName()=c) flag=1;要更改吗? if(d= double s;输入薪水 cin (*clerk).changeSalary(s); (*clerk).changeMf(); bre
13、ak; if(flag=0)!对不起!您要查询的职工不存在!您想继续查询吗?(y/n) while(d=);wokersApply(Worker *head) if(nemberOfopinions!=0)您有nemberOfopinions个信件 if(clerk!(*clerk).getLf()=1) cout(*clerk).getName()endl(*clerk).getID()(*clerk).getPerson() (*clerk).changeLf(); (*clerk).getLetter();要对他说些什么吗?输入恩 if(c=恩 string opinion;建议:opi
14、nion; (*clerk).changeLetter(opinion); Bossflag=1; while(clerk=NULL);CheckThesalary(Worker *head) char c; string name; do bool flag=0;请输入要查找的职工的姓名:name;name=(*clerk).getName() (*clerk).outPut(); if(flag=0)coutwhile(c!=c!n指令错误请输入y/n! while(c=promotion(Worker *head)/升职请输入ID char c; (*clerk).outPut(); if(*clerk).getRank()=员工已达最高级 else 确定是否升级 if(c= (*clerk).changeRank(char)(*clerk).getRank()-1),clerk); (*clerk).changeRf(); cout升职成功 else=
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1