C 语言
课程设计说明书
课 程 名 称:
题 目: 职工信息管理系统
专 业:
学 生 姓 名:
学 号:
课程设计成绩:
职工信息管理系统
目 录
1 引 言................................................................................................................................................................1
1.1 问题的提出...........................................................................................................................................1
1.2 国内外研究的现状...............................................................................................................................1
现今国内外大多注意在大型人事管理系统的开发,在小型人事管理系统却少有开发,但并非所
有的公司都实用与大型系统,所以小型系统有开发的必要。..............................................................1
1.3 任务与分析...........................................................................................................................................1
2 程序的主要功能.............................................................................................................................................2
2.1 添加功能...............................................................................................................................................2
2.2 删除功能...............................................................................................................................................2
2.3 显示功能...............................................................................................................................................2
2.4 按姓名查询功能...................................................................................................................................2
2.5 按职工号查询功能...............................................................................................................................2
2.6 按职工号修改功能...............................................................................................................................2
3 程序运行平台.................................................................................................................................................2
4 总体设计.........................................................................................................................................................3
5 模块分析.........................................................................................................................................................4
5.1 添加模块...............................................................................................................................................4
5.2 显示模块...............................................................................................................................................5
VOID SHOW(PLINK P).................................................................................................................................6
{...................................................................................................................................................................6
MESSAGE();.................................................................................................................................................6
PRINTF("浏览职工信息\N");.......................................................................................................................6
PRINTF("职工号\T 姓名\T 性别\T 出生日期\T 学历\T 工资\T 住址\T 电话\N");........................................6
WHILE(NULL!=P->NEXT)...........................................................................................................................6
{..................................................................................................................................................................6
PRINTF("%D\T%S\T%S\T%S\T%S\T%D\T%S\T%S\N",.................................................................................6
P->NEXT->W.ID,P->NEXT->W.NAME,P->NEXT->W.SEX,P->NEXT->W.DATY,...............................................6
P->NEXT->W.EDU,P->NEXT->W.WAGES,P->NEXT->W.ADR,P->NEXT->W.PHONE);......................................6
P=P->NEXT;.................................................................................................................................................6
}..................................................................................................................................................................6
PRINTF("显示完毕!\N");.............................................................................................................................6
} 5.3 按职工号查找模块............................................................................................................................6
PLINK FINDID(PLINK P,INT ID)..................................................................................................................7
职工信息管理系统
{...................................................................................................................................................................7
MESSAGE();.................................................................................................................................................7
PRINTF("按职工号查询\N");.......................................................................................................................7
PRINTF("职工号\T 姓名\T 性别\T 出生日期\T 学历\T 工资\T 住址\T 电话\N");........................................7
WHILE(NULL!=P->NEXT)...........................................................................................................................7
{..................................................................................................................................................................7
IF(P->NEXT->W.ID==ID)..............................................................................................................................7
{..................................................................................................................................................................7
PRINTF("%D\T%S\T%S\T%S\T%S\T%D\T%S\T%S\N",.................................................................................7
P->NEXT->W.ID,P->NEXT->W.NAME,P->NEXT->W.SEX,P->NEXT->W.DATY,...............................................7
P->NEXT->W.EDU,P->NEXT->W.WAGES,P->NEXT->W.ADR,P->NEXT->W.PHONE);......................................7
RETURN P;...................................................................................................................................................7
}..................................................................................................................................................................7
P=P->NEXT;.................................................................................................................................................7
}..................................................................................................................................................................7
PRINTF("查询结束!\N");.............................................................................................................................7
RETURN NULL;..........................................................................................................................................7
}...................................................................................................................................................................7
5.4 按姓名查找模块...................................................................................................................................7
PLINK FINDNAME(PLINK P,CHAR *NAME)................................................................................................8
{...................................................................................................................................................................8
MESSAGE();.................................................................................................................................................8
PRINTF("按姓名 查询\N");.........................................................................................................................8
PRINTF("职工号\T 姓名\T 性别\T 出生日期\T 学历\T 工资\T 住址\T 电话\N");........................................8
WHILE(NULL!=P->NEXT)...........................................................................................................................8
{..................................................................................................................................................................8
IF(0==STRCMP(P->NEXT->W.NAME,NAME))................................................................................................8
{..................................................................................................................................................................8
PRINTF("%D\T%S\T%S\T%S\T%S\T%D\T%S\T%S\N",.................................................................................8
P->NEXT->W.ID,P->NEXT->W.NAME,P->NEXT->W.SEX,P->NEXT->W.DATY,...............................................8
P->NEXT->W.EDU,P->NEXT->W.WAGES,P->NEXT->W.ADR,P->NEXT->W.PHONE);......................................8
RETURN P;...................................................................................................................................................8
}..................................................................................................................................................................8
P=P->NEXT;.................................................................................................................................................8
}..................................................................................................................................................................8
PRINTF("查询结束!\N");.............................................................................................................................8
RETURN NULL;..........................................................................................................................................8
}5.5 删除模块.............................................................................................................................................8
INT DEL(PLINK P,INT ID).............................................................................................................................9
{...................................................................................................................................................................9
MESSAGE();.................................................................................................................................................9
PRINTF("按职工号删除职工信息\N");.......................................................................................................9
WHILE(NULL!=P->NEXT)...........................................................................................................................9
{..................................................................................................................................................................9
职工信息管理系统
IF(P->NEXT->W.ID==ID)..............................................................................................................................9
{..................................................................................................................................................................9
PLINK Q=P->NEXT;....................................................................................................................................9
P->NEXT=P->NEXT->NEXT;.........................................................................................................................9
FREE(Q); //释放结点...................................................................................................................................9
PRINTF("删除成功!\N");.............................................................................................................................9
RETURN 1;...................................................................................................................................................9
}..................................................................................................................................................................9
P=P->NEXT;.................................................................................................................................................9
}..................................................................................................................................................................9
PRINTF("没有你输入的职工号!\N");.........................................................................................................9
RETURN -1;..................................................................................................................................................9
}5.6 修改模块............................................................................................................................................. 9
PLINK XG(PLINK P,INT ID)........................................................................................................................9
{..........................................................................................................................................................................9
MESSAGE();...................................................................................................................................................9
PRINTF("按职工号修改\N");.......................................................................................................................9
WHILE(NULL!=P->NEXT)..........................................................................................................................9
{.........................................................................................................................................................................9
IF(P->NEXT->W.ID==ID)...........................................................................................................................10
{.......................................................................................................................................................................10
PRINTF("请输入新的职工姓名(文字):");..............................................................................................10
SCANF("%S",&P->NEXT->W.NAME);...................................................................................................10
PRINTF("请输入新的职工性别(文字):");..............................................................................................10
SCANF("%S",&P->NEXT->W.SEX);.......................................................................................................10
PRINTF("请输入新的职工出生日期(数字):");......................................................................................10
SCANF("%S",&P->NEXT->W.DATY);....................................................................................................10
PRINTF("请输入新的职工学历(文字):");..............................................................................................10
SCANF("%S",&P->NEXT->W.EDU);......................................................................................................10
PRINTF("请输入新的职工工资(数字):");..............................................................................................10
SCANF("%D",&P->NEXT->W.WAGES);................................................................................................10
PRINTF("请输入新的职工住址(文字):");..............................................................................................10
SCANF("%S",&P->NEXT->W.ADR);......................................................................................................10
PRINTF("请输入新的职工电话(文字):");..............................................................................................10
SCANF("%S",&P->NEXT->W.PHONE);.................................................................................................10
职工信息管理系统
RETURN P;...................................................................................................................................................10
}........................................................................................................................................................................11
P=P->NEXT;..................................................................................................................................................11
}........................................................................................................................................................................11
PRINTF("修改结束!\N");............................................................................................................................11
RETURN NULL;...........................................................................................................................................11
} 6 系统测试....................................................................................................................................................11
6.1 职工信息录入.....................................................................................................................................11
6.2 职工信息浏览.....................................................................................................................................12
6.3 职工信息删除。.................................................................................................................................12
6.4 按姓名查询.........................................................................................................................................13
6.5 按职工号查询.....................................................................................................................................14
6.6 按职工号修改.....................................................................................................................................14
7 结论...............................................................................................................................................................15
7.1 总结.....................................................................................................................................................15
7.2 体会.....................................................................................................................................................16
致 谢.................................................................................................................................................................16
摘 要
随着计算机的普及,小型系统的编写有了很快的发展。本系统分析了任务
书中的要求,利用 C 语言编程实现了职工信息管理系统,该系统具有人员信息的
添加,删除,查找,修改和显示功能。
关键词:职工信息管理系统;计算机; 添加;删除;查找;修改。