c语言课程设计___职工信息管理系统

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

C语言课程设计

设计题目:职工信息管理系统

设计目的

当今时代是飞速发展的信息时代,在各行各业中离不开信息处理,这正是计算机被广泛应用于信息系统的环境。计算机的最到好处的于利用它能够进行信息管理,使用计算机进行信息控制,不仅提高了工作效率,而且大大的提高了其安全性。

尤其对于复杂的信息管理,计算机能够充分发挥它的优越性。计算机进行信息管理与信息管理系统的开发密切相关,系统的开发是系统管理的前提。本系统就是为了管理好学生选课信息而设计的。

数据处理手工操作,工作量大,出错率高,出错后不易更改,造成了时间上的浪费。

基于这个问题,我认为有必要建立一个学生选课系统,使学生选课信息管理工作规范化、系统化、程序化,避免学生选课管理的随意性,提高信息处理的速度和准确性,能够及时、准确、有效的查询和修改选课情况。

二、题目说明:

系统功能简介:

系统以菜单方式工作

1)职工信息录入(文件保存职工信息)

2)输出职工信息、浏览职工信息

3)查询职工信息

4)根据员工号查找职工信息

5)根据工资、年龄、性别对职工信息进行排序

6)删除职工信息

3. 设计实施:

#include

#include

#include

typedef struct Empk

{

int EmpNum; /* staff number */

char EmpName[12]; /* name*/

int Sex; /*sex 1- woman 2- man*/

int Old; /* old*/

int Cult; /*education background 1-specilist 2-doctor 3-others*/ int Salary; /*salary*/

char Address[12]; /* address*/

int Tell; /*telephone number*/

}Emp;

Emp emp[100];

void open()

{

int i;

FILE *fp;

if((fp=fopen("wyl","rb+"))==NULL)

{printf("can not do it! Because of no file of information\n");

exit(0);}

for(i=0;i<100;i++)

{if(fread(&emp[i],sizeof(Emp),1,fp)==0)

{printf("Fail to output\n");

exit(0);}

}

fclose(fp);

}

void close() /*跳出*/

{

int i;

FILE *fp;

if((fp=fopen("wyl","wr+"))==NULL)

{printf("can not do it!\n");

exit(0);}

for(i=0;i<100;i++)

fwrite(&emp[i],sizeof(Emp),1,fp);

fclose(fp);

}

void inputEmpInfo() /*输入信息*/

{

int i,k;

for(i=0;i<100;i++)

{

printf("Please enter the staff's :\nnumber:");

scanf("%d",&emp[i].EmpNum);

printf("\nname:");

scanf("%s",emp[i].EmpName);

printf("\nsex : 1- woman 2- man:");

scanf("%d",&emp[i].Sex);

printf("\nold:");

scanf("%d",&emp[i].Old);

printf("\nEducation background:1-specialist 2-doctor 3-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.yes 2.no)");

scanf("%d",&k);

if(k==2) break;

}

close();

}

void reorder() /*修改*/

{

int i,s,j,k,l;

Emp temp;

open();

printf("\nChoose which category would you want to use\n1---sex \n2---salary(from maximum to minimum) \n3--old (from maximum to minimum) \n ( enter the corresponding nember) \n)");

scanf("%d",&i);

switch(i)

{

case 1:

printf("\nchoose which sex do you want to inquire? 1--woman 2 --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("\nsex 1- woman 2- man:%d", emp[j].Sex);

printf("\nold:%d", emp[j].Old);

printf("\neducation background:%d\t\t\t 1-specialist 2-doctor 3-others ",emp[j].Cult);

printf("\nsalary:%d", emp[j].Salary);

相关文档
最新文档