您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 薪酬管理 > c语言课程设计---职工信息管理系统
C语言课程设计设计题目:职工信息管理系统设计目的当今时代是飞速发展的信息时代,在各行各业中离不开信息处理,这正是计算机被广泛应用于信息系统的环境。计算机的最到好处的于利用它能够进行信息管理,使用计算机进行信息控制,不仅提高了工作效率,而且大大的提高了其安全性。尤其对于复杂的信息管理,计算机能够充分发挥它的优越性。计算机进行信息管理与信息管理系统的开发密切相关,系统的开发是系统管理的前提。本系统就是为了管理好学生选课信息而设计的。数据处理手工操作,工作量大,出错率高,出错后不易更改,造成了时间上的浪费。基于这个问题,我认为有必要建立一个学生选课系统,使学生选课信息管理工作规范化、系统化、程序化,避免学生选课管理的随意性,提高信息处理的速度和准确性,能够及时、准确、有效的查询和修改选课情况。二、题目说明:系统功能简介:系统以菜单方式工作1)职工信息录入(文件保存职工信息)2)输出职工信息、浏览职工信息3)查询职工信息4)根据员工号查找职工信息5)根据工资、年龄、性别对职工信息进行排序6)删除职工信息3.设计实施:#includestdio.h#includestring.h#includestdlib.htypedefstructEmpk{intEmpNum;/*staffnumber*/charEmpName[12];/*name*/intSex;/*sex1-woman2-man*/intOld;/*old*/intCult;/*educationbackground1-specilist2-doctor3-others*/intSalary;/*salary*/charAddress[12];/*address*/intTell;/*telephonenumber*/}Emp;Empemp[100];voidopen(){inti;FILE*fp;if((fp=fopen(wyl,rb+))==NULL){printf(cannotdoit!Becauseofnofileofinformation\n);exit(0);}for(i=0;i100;i++){if(fread(&emp[i],sizeof(Emp),1,fp)==0){printf(Failtooutput\n);exit(0);}}fclose(fp);}voidclose()/*跳出*/{inti;FILE*fp;if((fp=fopen(wyl,wr+))==NULL){printf(cannotdoit!\n);exit(0);}for(i=0;i100;i++)fwrite(&emp[i],sizeof(Emp),1,fp);fclose(fp);}voidinputEmpInfo()/*输入信息*/{inti,k;for(i=0;i100;i++){printf(Pleaseenterthestaff's:\nnumber:);scanf(%d,&emp[i].EmpNum);printf(\nname:);scanf(%s,emp[i].EmpName);printf(\nsex:1-woman2-man:);scanf(%d,&emp[i].Sex);printf(\nold:);scanf(%d,&emp[i].Old);printf(\nEducationbackground:1-specialist2-doctor3-others);scanf(%d,&emp[i].Cult);printf(\nsalary:);scanf(%d,&emp[i].Salary);printf(\naddress:);scanf(%s,emp[i].Address);printf(\ntellphone:);scanf(%d,&emp[i].Tell);printf(continue?(1.yes2.no));scanf(%d,&k);if(k==2)break;}close();}voidreorder()/*修改*/{inti,s,j,k,l;Emptemp;open();printf(\nChoosewhichcategorywouldyouwanttouse\n1---sex\n2---salary(frommaximumtominimum)\n3--old(frommaximumtominimum)\n(enterthecorrespondingnember)\n));scanf(%d,&i);switch(i){case1:printf(\nchoosewhichsexdoyouwanttoinquire?1--woman2--man);scanf(%d,&s);for(j=0;emp[j].EmpNum!=0;j++){if(emp[j].Sex==s){printf(number:%d\n,emp[j].EmpNum);printf(name:%s,emp[j].EmpName);printf(\nsex1-woman2-man:%d,emp[j].Sex);printf(\nold:%d,emp[j].Old);printf(\neducationbackground:%d\t\t\t1-specialist2-doctor3-others,emp[j].Cult);printf(\nsalary:%d,emp[j].Salary);printf(\naddress:%s,emp[j].Address);printf(\ntelephonenember:%d,emp[j].Tell);}}break;case2:for(k=0;emp[k].EmpNum!=0;j++){for(l=k;emp[l].EmpNum!=0;l++){if(emp[l].Salaryemp[l+1].Salary){temp=emp[l];emp[l]=emp[l+1];emp[l+1]=temp;}}printf(number:%d\n,emp[k].EmpNum);printf(name:%s,emp[k].EmpName);printf(\nsex1-woman2-man:%d,emp[k].Sex);printf(\nold:%d,emp[k].Old);printf(\neducationbackground:%d\t\t\t1-specialist2-doctor3-others,emp[k].Cult);printf(\nsalary:%d,emp[k].Salary);printf(\nadress:%s,emp[k].Address);printf(\ntelephonenember:%d,emp[k].Tell);}break;case3:for(k=0;emp[k].EmpNum!=0;j++){for(l=k;emp[l].EmpNum!=0;l++){if(emp[l].Oldemp[l+1].Old){temp=emp[l];emp[l]=emp[l+1];emp[l+1]=temp;}}printf(number:%d\n,emp[k].EmpNum);printf(name:%s,emp[k].EmpName);printf(\nsex1-woman2-man:%d,emp[k].Sex);printf(\nold:%d,emp[k].Old);printf(\neducationbackground:%d\t\t\t1-specialist2-doctor3-others,emp[k].Cult);printf(\nsalary:%d,emp[k].Salary);printf(\naddress:%s,emp[k].Address);printf(\ntelephonenember:%d,emp[k].Tell);}break;}}voidshow(){intj;open();printf(\n-------------------------informationsofsraffs---------------------------\n);for(j=0;emp[j].EmpNum!=0;j++){printf(number:%d\n,emp[j].EmpNum);printf(name:%s,emp[j].EmpName);printf(\nsex1-woman2-man:%d,emp[j].Sex);printf(\nold:%d,emp[j].Old);printf(\neducationbackground:%d1-specialist2-doctor3-others,emp[j].Cult);printf(\nsalary:%d,emp[j].Salary);printf(\nadress:%s,emp[j].Address);printf(\ntelephonenember:%d,emp[j].Tell);}}voiddeleteEmp(){intj,k,m=1,d,i=0;open();printf(Enterthenumberwhosedateyouwanttodelete:\n);scanf(%d,&d);for(j=0;emp[j].EmpNum!=0;j++){if(emp[j].EmpNum==d){for(k=j;emp[j].EmpNum!=0;k++)emp[k]=emp[k+1];i++;}}if(i==0)printf(Thestaffsinformationsmanagesystermhasnodateofthenumberyourentered!!!\n);close();printf(succeeedtodelete\n);}voidfindByEmpName()/*查询*/{intj,i,k=0;open();printf(Pleaseenterthenumber:\n);scanf(%d,&i);for(j=0;emp[j].EmpNum!=0;j++){if(emp[j].EmpNum==i){printf(\n-------------------------informationofyourwant---------------------------\n);printf(number:%d\n,emp[j].EmpNum);printf(name:%s,emp[j].EmpName);printf(\nsex1-woman2-man:%d,emp[j].Sex);printf(\nold:%d,emp[j].Old);printf(\neducationbackground:%d\t\t\t\t1-specialist2-doctor3-others,emp[j].Cult);printf(\nsalary:%d,emp[j].Salary);printf(\nadress:%s,emp[j].Address);printf(\ntelephonenumber:%d,emp[j].Tell);k++;}}if(k==0)printf(\nHavenodateofthenumber!!!\n);}voidmenu(){printf(\n--------------------------------------------------------------------------\n);printf(\nWellcometothestaffmanagestyterm\n);printf(\n-------------------------------------------------------------------------\n);printf(Pleasechoosenumberforwhatareyouwanttodo:\n\n);printf(\n1----input:Completeinputingworkers
本文标题:c语言课程设计---职工信息管理系统
链接地址:https://www.777doc.com/doc-6342695 .html