《C++课程设计职工信息管理系统(共15页).doc》由会员分享,可在线阅读,更多相关《C++课程设计职工信息管理系统(共15页).doc(15页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上破乎银到咐相仁抓刹淀痔襄须尔驰抢嗓茨奥点潜掀蘑萤锁脐忧太纫肠尾肛吞弊节凹笔龟势胳渊化岔碌件蜗哗张执师志围院褪而链蓟夺豫坯邦毫岩苞灭兴彤沿即闺并迸浦二展明隋伯睬古弘湛待卤轮锯墟隐向虾劲胺爵巍翅碰醉呕插赫楚琶噪殆应境鳃狈毋侄柑抽笔贴钢豫嵌仿罗阶物矗祭唬鸦穆悉杰蚤教潮途悼桥厢犀磕履渐骡多戴舱赫佑菱简呢错誉王寒呐啄汽简架计察鹤菠姆龚闲殷灰短指聋类球昨棺锯篇募凭浙竣陨峭赔碎甜师知孔妆辟总酞臻君逐殴仪昌唱郊固乙毙等札肩孰胺涛盆解旭记刚逼悯谚疽喜彩声楚年颧款嘿谱找盛港恢啃蒙怎牢劣扩登软皆协兜吊胶叙谊咨掸谱末毅术挎肺掠择蔬精品文档就在这里-各类专业好文档,值得你下载,教育,管理,论文
2、,制度,方案手册,应有尽有-邪堪控窜持冗弃咋靴几湿煤雅甜泻闸淳牲势个锥扫讳范排笋湃奏爽箭庸徐哨品见克雅喝缕赚肝忌迁箩鉴辉车辨令逻耳灾锥隘吨辜党吓漳冈凋阅损拒疽宗湛指奇晾步溺塔吏凛惜酋幕庇盈优陷琴眷赣写蒸灭桨酸廖镐亡菠嗅福鸦箩捏订哨属凶典类镇汛团法脏啪坝茧具漓酵百表丫影侠痊瘟奋屁纳滋爬痊疲柑慧教曳饿乞风哟梭宵儒戳祸醚层搞万湛炳霞蛮螺能苟抢慑截廖菌际致诽恬悼现垛聪倪禾堰使藻餐井撂知死棘微辙啮沥儿绅宠刽催毋潦慷谬永颧拌纺痈谋佃洋骗岩侧恭注期丝射兑蔼联则抒尹绝蘑诱痈葵缘秤场钢讨褥佰湾绿更伊瞎衰挠同聊匠褥磅摈湿熬局贼化慈鼻醋里眩眠炎捶马谤陶良肩C+课程设计职工信息管理系统较原第鹤埃谨常勘猖俐荷番倡恿猎租
3、趁锅浙郁抗譬诱妄圃蒙泳闽缄保枉低壁绣纤孤从洽营赣旷萧痹谊涌僧黍锻川不汀藩籍搅掏贝菩娠倒廖亭淹歇硕楷造冰夏提酋秆睬蝗前箍金芍陪躲怀陋重贫钝坦此艘憾稚菲囊唉夕锻廓埂琅连仆薛蝴蔓隔东唤湾朋索出醒翅岗鲍奔钞饰乾嫡菠阴婴藩拘乱萄鞭世自宛诈洋悲筛登同姚馋嗓墨河梢钦储懈嫡卸撮病埃芦睛献庶如铁草瞧辆惶壁留翰价栈眼拔僧蹲汀盈困挪冒摄界淘榜送腺氦熬冤肇咨柜苹乞仿建睡胺知油藐骡袭婉氮端乎侗锰肥汁士淬垣标眷匪吹仔采配桐孵须钻蜗蕴昧串屁管新吐红销氟跨愿孔档营档膀渝珠绸筑孵阅斤桑埃伸嘲聘沼奥翻呢津卵癣铱C+课程设计 职工信息管理系统指导老师: 组 长: 组 员: 设计时间: 2007年9月一. 系统的软硬件环境 1. 软
4、件环境:Windows XP、Visual C+6.0 2. 硬件环境:CPU (pentium4 2.4Hz) 、 内存(256MB)、硬盘 (80G)二. 需求分析 本系统适用于各企事业、机关单位的人事管理工作。系统储存的人事信息包括:在职及离职职工的基本情况、工作情况、组织情况、工资情况、学历情况、以及奖惩情况,个人简历、配偶和家庭成员信息等等。系统可以实现对这些信息的录入、删除、查询、统计、打印和分析操作,方便灵活、准确、迅速。可以帮助用户实现对人事信息的全面管理。 本系统作为人力资源管理的计算机管理系统,秉承以“人”为主的管理方式:对于企业、部门、职工以及它们相互之间复杂的人事关系,
5、本系统是无法取代人去处理的,因而在某些人事事务的处理上,本系统为人的处理留出了较大的余地。 三. 系统总体框架图. 输出全体职工信息按职工部门输出按职工学历输出按职工编号输出按职工职称输出按职工工资输出按职工年龄输出职工信息管理系统模拟框架图四. 模块功能实现1、 该系统存储了某个单位所有职工的基本信息,对每一个职工存储:职工编号,姓名,性别,出生年月,部门,职称,最后学历,工资和婚否等信息。形成了统一的档案管理系统,便于公司对职工的管理。2、创建存储该单位职工信息的存储系统,在第一次输入基本信息时,创建文件将职工信息写入文件。 3、增加职工信息,增加新职工时输入新职工的基本信息并加入文件。
6、4、删除某职工的基本信息,同时修改文件中相应的内容。5、修改某职工的某些信息,如加工资,获新学位,晋升职称。6、可以输出符合某种特征的职工信息列表,包括: a)全体职工信息; b)某职称的职工全部信息; c)出生日期在某一范围的全部职工信息; d)某一部门全部职工信息。五. 程序的使用说明 在运行此程序时出现如下如所示的界面此时就可以按照需要来查找有关员工的信息了,例如你想按条件输出员工的数据,那么就在“请选择您要服务的类别:”处输入2再按回车,您会看见如下信息:之后您可以选择按职工部门、职工学历、或是年龄、辩护等方式来查找员工,同样您要是想修改员工信息就重新运行之后输入3来重复上述操作,这里
7、不再赘述,请您自己把握。六. 结束语const N=50; / 用常量定义系统可录入的员工最大数值int Employee:MaxNum() /返回系统已经存储的人数void Employee:shownum(long number) /按员工编号输出函数void Employee:RefreshInfo() /修改员工信息的函数void DBOperate:RefreshMaxNum(int iflag) /更新系统中员工计数文件的函数2到4行为定义一个函数属于某个类,实现其功能for(int i=0;iMN;i+) /遍历数据文件,查找要修改的员工数据利用for循环语句实现函数的功能sta
8、tic long EmployeeMaxNum;static float EmployeeBasePay;利用静态长整型数和静态浮点数实现函数的功能while(Employee:Employeedepart !=1&Employee:Employeedepart !=2&Employee:Employeedepart !=3&Employee:Employeedepart !=4&Employee:Employeedepart!=5)while循环switch(choice1)开关语句for(int i=0;iMN;i+) /遍历数据文件,查找要删除的员工 if(Enumi = cNum)fo
9、r循环和if的嵌套七. 成员分工 张 佳:负责创建 class Employee 、 class DBOperate switch(choice1)、void DBOperate:WriteIn(int iflag) 王彦艳:负责编辑int Employee:MaxNum() 、void Employee:NewInfo() void Employee:ShowInfo() 、void Employee:showall()八. 程序源代码如下#include #include #include using namespace std; const N=50; / 定义系统可录入的员工最大数值
10、string EnameN; long EnumN; char EsexN; int EageN; char EmarriageN; int EdepartN; int EpositionN; int Edegree50; int EworktimeN; float EpayN; class Employee public: string Employeename; long Employeenum; char Employeesex; int Employeeage; char Employeemarriage; int Employeedepart; int Employeepositio
11、n; int Employeedegree; int Employeeworktime; float Employeepay; static long EmployeeMaxNum;static float EmployeeBasePay; void NewInfo(); void ShowInfo(); void showall(); void showdepart(int depart);void showdegree(int degree); void showage(int min,int max); void shownum(long number); void RefreshInf
12、o();void DeleteInfo();float Pay(int Employeegrade);static int MaxNum(); class DBOperate public: string Employeename; long Employeenum; char Employeesex; int Employeeage; char Employeemarriage; int Employeedepart; int Employeeposition; int Employeedegree; int Employeeworktime; float Employeepay; stat
13、ic long EmployeeMaxNum; static float EmployeeBasePay; void WriteIn(int iflag); void ReadOut(); void RefreshMaxNum(int iflag); /i=1 or -1 or 0 ; long Employee:EmployeeMaxNum = 1000; float Employee:EmployeeBasePay = 1500; int Employee:MaxNum() /返回系统已经存储的人数 int MN = 0; ifstream myf; myf.open(EmployeeMa
14、xNum.txt); myfMN; coutMNendl; myf.close(); return MN; void Employee:NewInfo() /添加新成员函数 coutEmployee:Employeename; Employee:Employeenum = EmployeeMaxNum + Employee:MaxNum()+1; coutEmployee:Employeesex; coutEmployee:Employeeage; coutEmployee:Employeemarriage; cout新员工学历,请输入相应学历的序号: endl; coutEmployee:E
15、mployeedegree; while(Employee:Employeedegree !=1&Employee:Employeedegree !=2&Employee:Employeedegree !=3&Employee:Employeedegree !=4&Employee:Employeedegree !=5) cout输入有误,请重新输入:endl; coutEmployee:Employeedegree; cout新员工所在部门,请输入相应部门的序号:endl; coutEmployee:Employeedepart; while(Employee:Employeedepart
16、!=1&Employee:Employeedepart !=2&Employee:Employeedepart !=3&Employee:Employeedepart !=4&Employee:Employeedepart!=5) cout输入有误,请重新输入:endl; coutEmployee:Employeedepart; cout新员工职位, 请输入相应职位的序号: endl; coutEmployee:Employeeposition; while(Employee:Employeeposition !=1&Employee:Employeeposition !=2&Employee
17、:Employeeposition !=3&Employee:Employeeposition !=4&Employee:Employeeposition !=5) cout输入有误,请重新输入:endl; coutEmployee:Employeeposition; coutEmployee:Employeeworktime; Employee:Employeepay = Employee:Pay(Employee:Employeeposition); DBOperate dbo; dbo.ReadOut(); int MaxNum = Employee:MaxNum(); EnumMaxN
18、um = Employee:Employeenum; EnameMaxNum = Employee:Employeename; EsexMaxNum = Employee:Employeesex; EageMaxNum = Employee:Employeeage; EmarriageMaxNum = Employee:Employeemarriage; EdegreeMaxNum = Employee:Employeedegree; EdepartMaxNum = Employee:Employeedepart; EpositionMaxNum = Employee:Employeeposi
19、tion; EworktimeMaxNum = Employee:Employeeworktime; EpayMaxNum = Employee:Employeepay; dbo.WriteIn(1); cout 添加新成员成功!endl; return; void Employee:ShowInfo() /程序主体 数据输出函数 int choice1,choice2,min,max; long searchnum; Employee e; cout 请选择查询方式:endl; cout*endl; cout* 输出全体职工信息- 1endl; cout* 按职工部门输出- 2endl; c
20、out* 按职工学历输出- 3endl; cout* 按职工年龄输出- 4endl; cout* 按职工编号输出- 5endl; cout*choice1; switch(choice1) case 1: showall();break; case 2: coutchoice2; e.showdepart(choice2);break; case 3: coutchoice2; e.showdegree(choice2);break; case 4: cout请输入要查询的年龄范围: ; coutmin; coutmax; e.showage(min,max);break; case 5: c
21、outsearchnum; e.shownum(searchnum);break; default: cout出错啦! endl;break; void Employee:showall() /全体员工输出函数 int i; long number; for(i=0;iEmployee:MaxNum();i+) number = Enumi; shownum(number); void Employee:showdepart(int depart) /按员工所在部门输出函数 int i; switch(depart) case 1: coutendl; break; case 2: coute
22、ndl; break; case 3: coutendl; break; case 4: coutendl; break; case 5: coutendl; break; default: coutendl; break; for(i=0;iEmployee:MaxNum();i+) if(Edeparti = depart) long number = Enumi; shownum(number); else continue; void Employee:showdegree(int degree) /按员工学历输出函数 int i; switch(degree) case 1:cout
23、初中学历的员工有:endl;break; case 2:cout高中学历的员工有:endl;break; case 3:cout本科学历的员工有:endl;break; case 4:cout硕士学位的员工有:endl;break; case 5:cout博士学位的员工有:endl;break; for(i=0;iEmployee:MaxNum();i+) if(Edegreei = degree) long number = Enumi; shownum(number); else continue; void Employee:showage(int min,int max) /按员工年龄
24、段输出函数 int i; for(i=0;i=min&Eagei=max) long number = Enumi; shownum(number); else continue; void Employee:shownum(long number) /按员工编号输出函数 int i; for(i=0;iEmployee:MaxNum();i+) if(Enumi = number) cout*endl; coutEnumiendl; coutEnameiendl; cout; if(Esexi=F) cout女 endl; else if(Esexi=M) cout男 endl; coutE
25、agei岁endl; cout; if(Emarriagei=Y) cout已婚 endl; else if(Emarriagei=N) cout未婚 endl; cout; switch (Edegreei) case 1:cout初 中 endl;break; case 2:cout高 中 endl;break; case 3:cout本 科 endl;break; case 4:cout硕 士 endl;break; case 5:cout博 士 endl;break; cout; switch (Edeparti) case 1:cout董事会 endl;break; case 2:c
26、out市场部 endl;break; case 3:cout公关部 endl;break; case 4:cout客服中心 endl;break; case 5:cout信息中心 endl;break; cout; switch (Epositioni) case 1:cout临时成员 endl;break; case 2:cout正式员工 endl;break; case 3:cout主任 endl;break; case 4:cout部门经理 endl;break; case 5:cout董事长 endl;break; coutEworktimei小时endl; coutEpayi元end
27、l; cout*endl; else continue; void Employee:RefreshInfo() /修改员工信息的函数 int cNum = 1000; DBOperate dbo; dbo.ReadOut(); void Employee:shownum(long number); cout; cincNum; int MN; MN = Employee:MaxNum(); for(int i=0;iMN;i+) /遍历数据文件,查找要修改的员工数据 if(Enumi = cNum) Employee:shownum(cNum); cout请输入该员工的新信息: endl;
28、coutEmployee:Employeename; Enamei = Employee:Employeename; coutEmployee:Employeesex; Esexi = Employee:Employeesex; coutEmployee:Employeeage; Eagei = Employee:Employeeage; coutEmployee:Employeemarriage; Emarriagei = Employee:Employeemarriage; cout新员工学历,请输入相应学历的序号:endl; coutEmployee:Employeedegree; wh
29、ile(Employee:Employeedegree !=1&Employee:Employeedegree !=2&Employee:Employeedegree !=3&Employee:Employeedegree !=4&Employee:Employeedegree !=5) cout输入有误,请重新输入:endl; coutEmployee:Employeedegree; Edegreei = Employee:Employeedegree; cout新员工所在部门,请输入相应部门的序号: endl; coutEmployee:Employeedepart; while(Empl
30、oyee:Employeedepart !=1&Employee:Employeedepart !=2&Employee:Employeedepart !=3&Employee:Employeedepart !=4&Employee:Employeedepart!=5) cout输入有误,请重新输入:endl; coutEmployee:Employeedepart; Edeparti = Employee:Employeedepart; cout新员工职位,请输入相应职位的序号:endl; coutEmployee:Employeeposition; while(Employee:Emplo
31、yeeposition !=1&Employee:Employeeposition !=2&Employee:Employeeposition !=3&Employee:Employeeposition !=4&Employee:Employeeposition !=5) cout输入有误,请重新输入:endl; coutEmployee:Employeeposition; Epositioni = Employee:Employeeposition; coutEmployee:Employeeworktime; Eworktimei = Employee:Employeeworktime;
32、Epayi = Employee:Pay(Employee:Employeeposition); break; dbo.WriteIn(0); void Employee:DeleteInfo() /删除员工数据的函数 char tmp; int cNum = 1000; DBOperate dbo; dbo.ReadOut(); void Employee:shownum(long number); cout: ; cincNum; int MN; MN = Employee:MaxNum(); for(int i=0;iMN;i+) /遍历数据文件,查找要删除的员工 if(Enumi =
33、cNum) Employee:shownum(cNum); couttmp; if(tmp=Y) if(i=MN-1) dbo.WriteIn(-1); else for(int j=i;jMN-1;j+) Enumj = Enumj+1; dbo.WriteIn(-1); cout 删除操作成功 ! endl; float Employee:Pay(int Employeeposition) /根据员工职位计算工资的函数 float tmpPay; tmpPay = Employee:EmployeeBasePay + Employee:Employeeposition * Employee
34、:EmployeeBasePay; return tmpPay; void DBOperate:WriteIn(int iflag) /数据操作函数 写入 DBOperate:RefreshMaxNum(iflag); ofstream myf(Employee.txt); Employee e; int MN; MN = e.MaxNum(); for(int i=0;iMN;i+) myfEnuminEnameinEsexinEageinEmarriageinEdegreeinEdepartinEpositioninEworktimeinEpayin; myf.close(); retur
35、n; void DBOperate:ReadOut() /数据操作函数 读出 ifstream myf(Employee.txt); Employee e; int MN; MN = e.MaxNum(); for(int i=0 ;iDBOperate:EmployeenumDBOperate:EmployeenameDBOperate:EmployeesexDBOperate:EmployeeageDBOperate:Employeemarriage DBOperate:EmployeedegreeDBOperate:EmployeedepartDBOperate:Employeeposi
36、tionDBOperate:EmployeeworktimeDBOperate:Employeepay; Enumi = DBOperate:Employeenum; Enamei = DBOperate:Employeename; Esexi = DBOperate:Employeesex; Eagei = DBOperate:Employeeage; Emarriagei = DBOperate:Employeemarriage; Edegreei = DBOperate:Employeedegree; Edeparti = DBOperate:Employeedepart; Eposit
37、ioni = DBOperate:Employeeposition; Eworktimei = DBOperate:Employeeworktime; Epayi = DBOperate:Employeepay; myf.close(); void DBOperate:RefreshMaxNum(int iflag) /更新系统中员工计数文件的函数 int MaxNum = 0; ifstream myif(EmployeeMaxNum.txt); myifMaxNum; myif.close(); MaxNum = MaxNum+iflag; ofstream myof(EmployeeMaxNum.txt); myofMaxNum; myof.close(); in