欢迎来到天天文库
浏览记录
ID:38179346
大小:31.50 KB
页数:5页
时间:2019-05-24
《例5-11雇员管理系统》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、//employee.hclassemployee{protected:intindividualEmpNo;intgrade;floataccumPay;staticintemployeeNo;public:employee();~employee();voidpromote(int);voidSetaccumPay(float);intGetindividualEmpNo();intGetgrade();floatGetaccumPay();};//employee.cpp#include#include"
2、employee.h"usingnamespacestd;intemployee::employeeNo=1000;employee::employee(){individualEmpNo=employeeNo++;grade=1;accumPay=0.0;}employee::~employee(){}voidemployee::IncreaseEmpNo(intsteps){individualEmpNo+=steps;}voidemployee::promote(intincrement){grade+=increment;
3、}voidemployee::SetaccumPay(floatpa){accumPay=pa;}intemployee::GetindividualEmpNo(){returnindividualEmpNo;}intemployee::Getgrade(){returngrade;}floatemployee::GetaccumPay(){returnaccumPay;}//5-11.cpp#include#include"employee.h"usingnamespacestd;main(){employe
4、em1;employeet1;employeesm1;employees1;cout<<"请输入下一雇员的月薪";floatpa;cin>>pa;m1.promote(3);m1.SetaccumPay(pa);cout<<"请输入下一雇员的月薪";cin>>pa;t1.promote(2);t1.SetaccumPay(pa);cout<<"请输入下一雇员的月薪";cin>>pa;sm1.promote(2);sm1.SetaccumPay(pa);cout<<"请输入下一雇员的月薪";cin>>pa;s1.SetaccumPa
5、y(pa);//显示m1信息cout<<"编号"<6、rade()<<”级,本月工资”<
6、rade()<<”级,本月工资”<
此文档下载收益归作者所有