版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、c+课程设计之企业人事信息管理系统一整体描述:随着现代工业的发展,企业的规模越来越庞大,传统的人员信息管理方式显然已经不再满足企业的现代化管理。企业人事信息管理方式的改革势在必行。1 课程设计名称:人员信息管理系统2 课程设计类型:设计型3 课程设计目的:学会综合运用已学的c+知识,用面向对象的技术实现一个小型的应用程序。4 课程设计原理:面向对象程序分析与设计、类的灵活运用、继承和派生、多态技术、模板技术、异常处理等5课程设计内容:某小型公司,需要存储管理公司雇员的编号、姓名、级别、月薪等信息,通过面向对象技术来实现一个简单的人员信息管理程序,它具有如下一些功能:(1)人员信息基本管理,包括
2、人员信息的录入、修改和删除;(2)能够自动设置员工的编号,即每增加一位新员工,编号增一;(3)能够分别对不同级别的员工(如经理、技术人员、推销人员等)按照不同的公式计算其工资收入;(4)能够将人员信息保存到磁盘上,以便程序下次运行时使用;(5)具有一定的排错功能,如当用户输入错误数据时提示用户;(6)能够实现一定程度的查询和统计功能。(7)其他你能想到并对系统有用的功能。在实现程序功能的基础上,尽量运用所学知识,改进程序实现方法,提高程序的可读性、模块性、可扩展性、可重用性和健壮性。公司人员结构分析:经理工作人员销售人员二 功能设计:本项目是为了实现对一般小型企业人事信息的管理而设计的,基本能
3、够满足一般小型企业的人事信息管理需求。1人员信息基本管理,包括人员信息的录入、修改和删除;2能够自动设置员工的编号,即每增加一位新员工,编号增一;3能够分别对不同级别的员工(如经理、技术人员、推销人员等)按照不同的公式计算其工资收入;4能够将人员信息保存到磁盘上,以便程序下次运行时使用;5具有一定的排错功能,如当用户输入错误数据时提示用户;6能够实现一定程度的查询和统计功能;7为系统提供密码保护;8公司人员信息统计。程序流程:开始进入系统选择进入方式游客进入(密码:0000)管理员进入(密码:2075)清除输出删除退出输出查找退出修改查找录入三代码实现(代码实现的界面展示):1 异常处理:/e
4、xception_function.cppint exception:checknnumber(char num)/处理员工工号合法性 tryif (strncmp(200,num,3)|strlen(num)!=8)throw 输入非法字符!;catch(char str )coutstrendl;return 1;return 0;int exception:checkname(char n)/处理员工姓名合法性tryif (strlen(n)10)throw 输入长度错误!;catch(char str )coutstrendl;return 1;return 0;int excepti
5、on:checksamenum(char num)/处理重复工号情况 personlist list;try if (list.findsamenum(num)throw 有重复的编号!; catch(char str )coutstrendl;list.closelist();return 1;return 0;2. /人员信息定义:class person/编号、姓名、级别、月薪public: char number20;char name20;int status;float salery;int id;public: friend ostream& operator(ostream&
6、os,person pe);class worker :public person /定义普通员工派生类,public: /由计算每月工资,设置工时,读出id号码等功能worker();void pay3();void sethours();void get(char num,char name);void getid(int id);void insert();private:float income;int basicweage;float rate;int hours;class seller:public person /定义营销人员派生类public: /由计算每月工资,设置工时,读
7、出id号码等功能seller();void get(char num,char name );void getid(int id);void insert();void pay2();void sethours();private:int basicweage;float rate;int hours;float income;class manager:public person /定义部门经理派生类public: /由计算每月工资,设置工时,读出id号码等功能 manager(); void get(char num,char name); void getid(int id); void
8、 insert(); void pay1();private:int basicweage;float income;class personlist /定义了一个全部人员链表类,并集合了各种操作 person test;person test1;std:listpersonlist;std:list:iterator ptr;public:void readlist(); /从文件中读出list成员到程序的list容器中void find(char num); /查找员工数据void countall(); /计算每个等级员工的人数和总人数void printlist(); /输出所有员工数
9、据void closelist(); / 关闭list 并写入记事本void clearlist(); /清空数据表void deleteperson(char num);/删除信息;void modify(char num); /修改成员数据int getid(); /获取idvoid fileread(); /将更新后的文本写入记事本int findsamenum(char num); /判断是否有重名现象;class decorate /定义了所有控制台输出信息类,以及前端密码进入功能public:decorate();void info_and_chose(); /密码判断void a
10、ccess(); /密码进入void info_of_operate(); char getch(); /登录用户判断void insert_of_info();private:char code10;char mastercode10;char guestcode10;char way;char ch;class exception /异常类public:int checknnumber(char num);int checkname(char n);int checksamenum(char num);3.进入系统:void decorate:info_and_chose()cout*欢迎
11、进入c+课程设计之企业人事管理系统*endl;cout*本小组成员有:*endl;while (1)cout请选择进入方式:(游客入口g,管理员入口m)way;if (way=g)ch=g;access();break;else if (way=m)ch=m;access();break;elsecout您未正确的进行输入!endl;4. 人员信息的录入、修改和删除#include main_class_h.hvoid personlist:readlist() /所有记录单元全部放在链表中,方便操作ifstream filein;filein.open(tom.txt);if (!filei
12、n)coutcannt open the file!status=1)cnt1+;else if(ptr-status=2)cnt2+;elsecnt3+;cnt4+;cout*;cout公司中经理成员的人数是:cnt1人*endl;cout*;cout公司中营销成员的人数是:cnt2人*endl;cout*;cout公司中普通工人的人数是:cnt3人*endl;cout*;cout公司中全部成员的人数是:cnt4人*endl;void personlist:find(char num)cout*员工数据信息表*;cout*endl;coutendl;coutendl;cout-endl;co
13、utid号码setw(15)员工编号setw(18)等级;coutsetw(18)姓名setw(12)工资endl;cout-number,num)coutnumber,num)cout*ptr;ptr+;return 1;elseptr+;return 0;void personlist:printlist() /输出所有员工数据 cout*员工数据信息表*;cout*endl;coutendl;coutendl;cout-endl;coutid号码setw(15)员工编号setw(18)等级;coutsetw(18)姓名setw(12)工资endl;cout-endl;for (ptr=p
14、ersonlist.begin();ptr!=personlist.end();ptr+)cout*ptr;void personlist:closelist() ofstream fileout(tom.txt);if (!fileout)coutcannt open the file!number,num)cout*ptr;personlist.erase(ptr+);cout已经删除!id;personlist.clear();return i;void personlist:modify(char num)char tname20;char tnum20;int tstatus;int
15、 choise;readlist();for (ptr=personlist.begin();ptr!=personlist.end();) if (!strcmp(ptr-number,num)cout1.修改名字;endl;cout2.修改编号;endl;cout3.修改职位;choise;switch(choise)case 1:cout输入新名字:tname;strcpy(ptr-name,tname);cout修改成功!endl;break;case 2:cout输入新编号:tnum;strcpy(ptr-number,tnum);cout修改成功!endl;break;case 3
16、:cout输入新职位:tstatus;ptr-status=tstatus;cout修改成功!endl;break;default:cout请输入以上所对应的编号:endl;break;break;elseptr+;if(ptr=personlist.end() cout无此编号!endl;closelist();void personlist:fileread()ofstream dataout;dataout.open(datalist.txt);if (!dataout)coutcannt open the file!number);len2=strlen(ptr-name);for(i
17、nt i=0;inumber+i);for(i=0;istatus+0);dataout.put(ch);for(i=0;i8;i+)dataout.put( );for (int j=0;jname+j);dataout.put(n);dataout.close();恋爱运up一绪lets月亭方正!気持今flying get!dou都斗豆逗陡抖痘兜读蚪窦篼蔸乧侸兠凟剅吺唗投斣枓梪橷毭氀浢渎渎瞗窬窦脰艔豆读逾郖酘酡钭鋀钭閗闘阧餖饾斗鬦鬪鬬鬭du读度毒渡堵独肚镀赌睹杜督都犊妒顿蠹笃嘟渎椟牍黩髑芏儥凟剢剫匵厾噣土涂妬嬻剬塅媏彖断毈瑖碫篅簖缎专腶葮褍踹躖锻鍴mr najib met search c
18、rews at pearce raaf base near perth on thursday morning, before their planes left for the day, and then later held talks with mr abbott.the disappearance of mh370 has tested our collective resolve, he told a news conference.faced with so little evidence, and such a herculean task, investigators from
19、 malaysia, the us, the uk, china, australia and france have worked without pausehe thanked both search teams and the australian government for their efforts in recent weeks, and said the search would go on.continue reading the main storymh370 - facts at a glance 8 march:malaysia airlines kuala lumpu
20、r-beijing flight carrying 239 people disappears planes transponder, which communicates with ground radar, was switched off as it left malaysian airspace satellite pings indicate plane was still flying seven hours after satellite contact was lost 24 march:based on new calculations, malaysian pm says
21、beyond reasonable doubt that plane crashed in southern indian ocean with no survivors what we know the search for flight mh370i know that until we find the plane, many families cannot start to grieve. i cannot imagine what they must be going through. but i can promise them that we will not give up,
22、he said.malaysian authorities have come in for heavy criticism over their management of the search, especially from relatives of thweather conditions were fair, with visibility of approximately 10km (6 miles), the joint agency coordination centre (jacc) - which is overseeing the search - said.the br
23、itish submarine hms tireless is also in the southern indian ocean and is due to be joined by royal navy ship hms echo.the australian navy ship ocean shield is heading to the region and has equipment for detecting the planes black-box flight recorder.experts say timing is critical as the flight recor
24、der may only have enough battery power to send out a signal until 7 april.air chief marshall angus houston, head of the jacc, warned that the search operation faced multiple difficulties.this is one of the most demanding and challenging search and rescue operations, or search and recovery operations
25、, that i have ever seen and i think probably one of the most complex operations of this nature that the world has ever seen, he told mr najib and mr abbott.on wednesday malaysian police chief khalid abu bakar said investigators had cleared all passengers of possible involvement in hijacking, sabotag
26、e or having personal or psychological problems that could have been connected to the disappearance.but he said that the criminal investigation could go on and on and on. we have to clear every little thing.at the end of the investigations, we may not even know the real cause. we may not even know th
27、e reason for this incident, he added.the police chief said that more than 170 interviews had been conducted with family members of the pilots and crew members, and that even cargo and food served on the plane were being investigated in case ofdui对队堆兑敦镦碓怼憝兊兑垖埻塠夺夺対对嵟憞怼捶杸濧濻瀢瀩痽磓祋綐膭薱謉譈譵追鈗锐锐錞鎚镦鐜锐陮队頧鴭dul乧d
28、un吨顿蹲墩敦钝盾囤遁不趸沌盹镦礅炖砘伅俊吨墪壿庉忳敦憞撉撴楯橔潡炖犜獤碷腞腯蜳豚踲蹾趸逇遯钝镦鐜顿驐duo多朵夺舵剁垛跺惰堕掇哆驮度躲踱沲咄铎裰哚缍亸仛兊兑兑凙刴剟剫吋喥嚉嚲垜埵堕墯夛夺奲媠嫷尮崜嶞憜挅挆捶揣敓敚敠敪朶杂杕枤柁柂柮桗棰椯椭毲沰沱泽痥硾缍茤袳詑誃貀趓跢跥跿躱軃郸郸鈬錞锗铎锗陀陊隋隋隓飿饳驮駄鬌鮵鵽点e饿哦额鹅蛾扼俄讹阿遏峨娥恶厄鄂锇谔垩锷阏萼苊轭婀莪鳄颚腭愕呃噩鹗屙亚亜亚伪佮侉偔伪伪僫匎匼卾吪呝咢咹哑唖啈啊啐哑恶囐囮垭垭垩堨堮妸妿姶娾娿媕屵岋峉峩崿庵廅悪恶戹搕搤搹擜曷枙桠櫮唉歞歹歺洝涐湂猡珴琧痷皒睋砈砐砨砵硆硪磀礘胺蒍蕚蘁蚅蝁覨讹咯誐谔譌讍豟轭軶輵迗遌遻邑鈋锇锷鑩閜阏阨阸隘頞頟额颚饿餩騀鬲魤魥鳄鰪鳄鴳鵈鹅鵞鹗齃腭齾青年()、技术()、恋爱()、翡翠()、読书()、人(,)、幸福()、训读词汇:青()、术()、恋()、好()、読()、人()、幸()、汉字“海”可以读成“”也可以读成“”。“”是它的音读,“”是它的训读。“史宪巨”等汉字一般只使用它们的一种音读,“贝又咲()”一般只使用它们的一种训读,但这类汉字较少。日语里的汉字通常都有两三种甚至更多的音训读发音。比如“生”,音读可读作“”,训读可读作“”等。同上面所说的,汉字每个字都有与之对应的音读、训读,但也有一些比较特殊。比如“梅雨”,它的发音为“”,不
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 广东省香洲区四校联考2026届初三下学期第一周综合自测化学试题含解析
- 2026届广东省揭阳市惠来县高中毕业班第二次质量预测化学试题含解析
- 浙江省台州市温岭市实验校2025-2026学年初三下学期期中生物试题理试卷含解析
- 广东省中学山大附属中学2026年初三下学期入学摸底联合考试化学试题含解析
- 2026年智能变频空调器IPM模块电路故障检测点
- 2026年液态阻焊材料与阻焊薄膜工艺适配性选择指南
- 2026年手机AI专利布局与标准必要专利策略
- 2025年临床医学实习测试卷
- 教育行业市场部面试攻略
- 铁路客运服务质量经理培训资料
- 2026年江西旅游商贸职业学院单招职业适应性测试题库含答案解析
- 2026吉林农业大学三江实验室办公室招聘工作人员考试参考题库及答案解析
- 2023年12月英语四级真题及答案-第3套
- 2026年内蒙古商贸职业学院单招职业技能测试题库带答案详解(考试直接用)
- 高职高专学生心理健康教育 第四版 课件 第第五讲 相伴适应路
- 心血管疾病健康知识科普
- 农副产品营销培训课件
- 装饰工程施工质量方案
- 零碳产业园区实施路径规划
- 机电排灌培训
- 格宾笼技术教学课件
评论
0/150
提交评论