您好,欢迎访问三七文档
#includeiostream#includectime#includestring#includefstream#includeiomanip#includecstdlib#includecmath#includewindows.husingnamespacestd;intcount=0;doubletotalPay=0;intnemberOfopinions=0;ofstream*file[50];intBossflag=0;voidmenu();intpassword();classProfession//职业{charrank;//等级floatbasicSalary;//基础工资floatallowance;//津贴floatmedicalInsurance;//医疗保险doubleoverTimePay;//加班费public:Profession(charnr=0,floatnb=0,floatna=0,floatnm=0,doubleno=0):rank(nr),basicSalary(nb),allowance(na),medicalInsurance(nm),overTimePay(no){}//构造chargetRank(){returnrank;}voidinputRank(charc);floatgetBasicSalary(){returnbasicSalary;}voidinputBasicSalary(floatb);floatgetAllowance(){returnallowance;}voidinputAllowance(floati);floatgetMedicalInsurance(){returnmedicalInsurance;}voidinputMedicalInsurance(floatm);doublegetOverTimePay(){returnoverTimePay;}voidinputOverTimePay(doubleo);};voidProfession::inputRank(charc){rank=c;}voidProfession::inputAllowance(floati){allowance=i;}voidProfession::inputBasicSalary(floatb){basicSalary=b;}voidProfession::inputMedicalInsurance(floatm){medicalInsurance=m;}voidProfession::inputOverTimePay(doubleo){overTimePay=o;}/*classLetter{stringletter;public:stringgetL(){returnletter;}};*/classWorker:publicProfession//员工{stringname,profession,letter;intID;doublewages;//税后工资doublesalary;//税前工资doubletotalWorkingtime;//总工时charperson;//态度//等级intpersonalPassword;//个人密码intrankflag;//升级标志intletterflag;//信件intmoneyflag;//加薪标志public:Worker(intx=0,inty=0,intz=0):rankflag(x),letterflag(y),moneyflag(z){}stringgetName(){returnname;}voidinputName(stringn);intgetID(){returnID;}voidinputID(inti);stringgetProfession(){returnprofession;}voidinputProfession(stringp);voidgetLetter(){coutletter;}voidchangeLetter(strings);doublegetWages(){returnwages;}voidgetTotalworkingtime(doublet);doublereTotalworkingtime(){returntotalWorkingtime;}chargetPerson(){returnperson;}doublegetSalary(){returnsalary;}intgetMf(){returnmoneyflag;}intgetRf(){returnrankflag;}intgetLf(){returnletterflag;}voidchangeLf();voidchangeMf();voidchangeRf();voidchangeSalary(doubles);voidevaluation();voidoutPut();voidoriginalSalary();voidcalculateSalary();voidCongratulation();voidopinion();voidcheck(Worker*head);voidchangeRank(charc,Worker*clerk);classWorker*next;};voidWorker::changeLetter(strings){letter=s;}voidWorker::inputName(stringn){name=n;}voidWorker::inputID(inti){ID=i;}voidWorker::inputProfession(stringp){profession=p;}voidWorker::getTotalworkingtime(doublet){totalWorkingtime=t;}voidWorker::changeLf(){letterflag--;}voidWorker::changeMf(){moneyflag++;}voidWorker::changeRf(){rankflag++;}voidWorker::changeSalary(doubles){salary=s;}voidWorker::originalSalary()//无税{salary=getBasicSalary()+(totalWorkingtime-8*30)*getOverTimePay()+getAllowance()+getMedicalInsurance();totalPay=totalPay+salary;}voidWorker::calculateSalary()//税{if(salary5000){wages=salary-salary*0.5;}elseif(salary1000&&salary=5000){wages=salary-salary*0.3;}}voidWorker::evaluation(){if(totalWorkingtime30)person='D';elseif(totalWorkingtime=30&&totalWorkingtime60)person='C';elseif(totalWorkingtime=60&&totalWorkingtime90)person='B';elseif(totalWorkingtime=90)person='A';}voidWorker::outPut()//数出{cout姓名setw(8)IDsetw(8)职业setw(8)基本工资setw(8)津贴setw(8)医保setw(8)总工时setw(8)工作评价setw(8)工资endl;coutgetName()setw(8)IDsetw(8)professionsetw(8)getBasicSalary()setw(8)getAllowance()setw(8)getMedicalInsurance()setw(8)reTotalworkingtime()setw(8)getPerson()setw(8)getWages()endl;}voidWorker::Congratulation()//祝贺{if(rankflag==1){cout恭喜您升职了endl;rankflag=0;}elseif(moneyflag==1){cout恭喜您加薪了endl;moneyflag=0;calculateSalary();cout您现在薪水为wagesendl;}}voidWorker::opinion()//意见{cinletter;nemberOfopinions++;letterflag=1;}voidWorker::check(Worker*head)//{Worker*clerk=head-next;intid;chars;stringd;cout输入您的IDendl;cinid;if(clerk!=NULL&&id==(*clerk).getID()){(*clerk).Congratulation();if(Bossflag==1){cout有信件endl;(*clerk).getLetter();Bossflag=0;}(*clerk).outPut();cout是否提出申请endl;couty/nendl;cins;if(s=='y'){coutinput:endl;cind;(*clerk).opinion();}}}voidWorker::changeRank(charr,Worker*clerk)//等级{Professiona('a',8000,2000,200,300),b('b',7000,1500,150,200),c('c',6000,1000,100,100),d('d',3000,500,50,70);if(r=='a'){(*clerk).inputRank(a.getRank());(*clerk).inputBasicSalary(a.getBasicSalary());(*clerk).inputMedicalInsurance(a.getMedicalInsurance());(*clerk).inputAllowance(a.getAllowance());(*clerk).inputOverTimePay(a.getOverTimePay());}elseif(r='b'){(*clerk).inputRank(b.getRank());(*clerk).inputBasicSalary(b.getBasicSalary());(*clerk).inputMedicalInsurance(b.getMedicalInsurance());(*clerk).inputAllowance(b.getAllowance());(*clerk).inputOverTimePay(b.getOverTimePay());}elseif(r='c'){(*clerk).inputRank(c.getRank());(*clerk).inputBasicSalary(c.getBasicSalary());(*clerk).inputMedicalInsurance(c.getMedicalInsurance());(*clerk).inputAllowance(c.getAllowance());(*clerk).inputOverTimePay(c.getOverTimePay());}elseif(r='d'){(*clerk).input
本文标题:C++员工管理系统
链接地址:https://www.777doc.com/doc-4948287 .html