职工信息管理系统源代码

上传人:ni****g 文档编号:489853985 上传时间:2023-02-21 格式:DOC 页数:12 大小:41KB
返回 下载 相关 举报
职工信息管理系统源代码_第1页
第1页 / 共12页
职工信息管理系统源代码_第2页
第2页 / 共12页
职工信息管理系统源代码_第3页
第3页 / 共12页
职工信息管理系统源代码_第4页
第4页 / 共12页
职工信息管理系统源代码_第5页
第5页 / 共12页
点击查看更多>>
资源描述

《职工信息管理系统源代码》由会员分享,可在线阅读,更多相关《职工信息管理系统源代码(12页珍藏版)》请在金锄头文库上搜索。

1、源代码#include #include #include #include double Cwage; double Swage; double Mwage; int ID; class Ddegree protected: int Num; char Name20; char Sex10; int Borntime; int Age; int degree; double Salary; Ddegree *next; public: Ddegree(char ID,char *Ename,char *Esex,int Eborntime,int Edegree) this-Num=ID;

2、strcpy(this-Name,Ename); strcpy(this-Sex,Esex); this-Borntime=Eborntime;this-degree=Edegree; void Getage()Age=2009-Borntime;virtual void Calcwage()=0; virtual void Output()=0; friend class Company; ; class Xxs:public Ddegree private: double Workload; public: Xxs(char ID,char *Ename,char *Esex,int Eb

3、orntime,int Edegree,double Eworkload):Ddegree(ID,Ename,Esex,Eborntime,Edegree) this-Workload=Eworkload; double GetWorkload() return Workload; void SetWorkload(double Amount) this-Workload=Amount; void Calcwage() Salary=Cwage+Workload*20; void Output() Getage();Calcwage(); coutNumtNametSextBorntime年t

4、Age岁t小学生tSalaryWorkload=Eworkload; double GetWorkload() return Workload; void SetWorkload(double Amount) this-Workload=Amount; void Calcwage() Salary=Swage+Workload*20+1000; void Output() Getage();Calcwage(); coutNumtNametSextBorntime年tAge岁t初中生tSalaryWorkload=Eworkload; double GetWorkload() return W

5、orkload; void SetWorkload(double s) Workload=s; void Calcwage() Salary=Mwage+Workload*20+1000; void Output() Getage();Calcwage(); coutNumtNametSextBorntime年tAge岁t高中生tSalaryendl; ; class Dxs:public Ddegree public: Dxs(char ID,char *Ename,char *Esex,int Eborntime,int Edegree):Ddegree(ID,Ename,Esex,Ebo

6、rntime,Edegree) void Calcwage() Salary=Mwage+2000; void Output() Getage();Calcwage(); coutNumtNametSextBorntime年tAge岁t大学生tSalarynext; delete Worker; Worker=p; Worker=0; char Name20; void Add(); void Modify(); void Delete(); void Query(); void Set(); void Save(); ; void Company:Add() Ddegree *p; char

7、 Name20; char Sex10; int Borntime; int degree; double Workload; coutn* 新增职工 *n; coutID; coutName;coutSex;coutBorntime;coutdegree; while(degree !=1°ree !=2°ree !=3°ree !=4) cout输入有误,请重新输入:endl; coutdegree; if(degree!=4) coutWorkload; switch(degree) case 1:p=new Xxs(ID,Name,Sex,Borntime,degre

8、e,Workload); break; case 2:p=new Czs(ID,Name,Sex,Borntime,degree,Workload); break; case 3:p=new Gzs(ID,Name,Sex,Borntime,degree,Workload); break; case 4:p=new Dxs(ID,Name,Sex,Borntime,degree); break; p-next=0; if(Worker) Ddegree *p2; p2=Worker; while(p2-next) p2=p2-next; p2-next=p; else Worker=p; co

9、ut新增职工成功!endl; void Company:Modify() int Num; int degree=NULL; double Workload; coutn* 修改职工信息 *n; coutNum; Ddegree *p1,*p2; p1=Worker; while(p1) if(p1-Num=Num) break; else p2=p1; p1=p1-next; if(p1!=NULL) p1-Output(); coutp1-Name; coutp1-Sex;coutp1-Borntime;if(degree=1) coutWorkload; (Xxs *)p1)-SetWorkload(Workload); else if(degree=2) coutWorkload; (Czs *)p1)-SetWorkload(Workload); else if(degree=3) coutWorkload; (Gzs *)p1)

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 建筑/环境 > 综合/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号