职工工资管理系统C语言Word文档格式.docx

上传人:b****5 文档编号:18884558 上传时间:2023-01-02 格式:DOCX 页数:26 大小:204.51KB
下载 相关 举报
职工工资管理系统C语言Word文档格式.docx_第1页
第1页 / 共26页
职工工资管理系统C语言Word文档格式.docx_第2页
第2页 / 共26页
职工工资管理系统C语言Word文档格式.docx_第3页
第3页 / 共26页
职工工资管理系统C语言Word文档格式.docx_第4页
第4页 / 共26页
职工工资管理系统C语言Word文档格式.docx_第5页
第5页 / 共26页
点击查看更多>>
下载资源
资源描述

职工工资管理系统C语言Word文档格式.docx

《职工工资管理系统C语言Word文档格式.docx》由会员分享,可在线阅读,更多相关《职工工资管理系统C语言Word文档格式.docx(26页珍藏版)》请在冰豆网上搜索。

职工工资管理系统C语言Word文档格式.docx

voiddel();

//删除职工信息

voidxmsc();

//按姓名删除

voidghsc();

//按工号删除

voidstatistics();

//个人工资统计

voidstatistic();

//统计职工信息

voidgzdtj();

//按工资段统计

voidbmtj();

//按部门统计

voidmodify();

//修改职工信息

voidghxg();

//按工号修改

voidxmxg();

//按姓名修改

voidreserve();

//保存职工信息

1、添加职工信息:

添加函数流程图

2、查看职工信息:

查看函数流程图

3、查找职工信息:

查找函数流程图

4、删除职工信息:

删除函数流程图

5、个人工资统计

个人工资统计流程图

6、统计职工工资

工资统计流程图

7、修改职工工资

修改函数流程图

4、程序代码

#include<

stdio.h>

stdlib.h>

string.h>

structworker

{chardepa[30];

charname[30];

charID[10];

intsalary1,salary2,salary3,salary4;

};

intdq(structworkerwo[]);

voidbc(structworkerwo[]);

voidback();

structworkerwo[100];

//保存所有的职工信息

intNumber=0;

//记录总的职工人数

voidmain()

{

intchoose=0;

while

(1)

{

show();

printf("

\t\t====>

请选择:

"

);

scanf("

%d"

&

choose);

system("

cls"

switch(choose)

case0:

exit(0);

//退出

break;

case1:

add();

back();

case2:

see();

//查看职工信息

case3:

search();

case4:

del();

case5:

statistics();

case6:

statistic();

//统计职工工资

case7:

modify();

case8:

reserve();

//保存数据

default:

}

fflush(stdin);

intdq(structworkerwo[])

FILE*fp=NULL;

inti=0;

while(fread(&

wo[i],sizeof(structworker),1,fp))

i++;

fclose(fp);

returni;

voidshow()

\n"

\t****************职工工资管理系统****************\n\n"

\t*☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆*\n\n"

\t^^^^^^^^^^^^^^^[1]添加职工信息^^^^^^^^^^^^^^^^^\n"

\t^^^^^^^^^^^^^^^[2]查看职工信息^^^^^^^^^^^^^^^^^\n"

\t^^^^^^^^^^^^^^^[3]查找职工信息^^^^^^^^^^^^^^^^^\n"

\t^^^^^^^^^^^^^^^[4]删除职工信息^^^^^^^^^^^^^^^^^\n"

\t^^^^^^^^^^^^^^^[5]个人工资统计^^^^^^^^^^^^^^^^^\n"

\t^^^^^^^^^^^^^^^[6]统计职工工资^^^^^^^^^^^^^^^^^^\n"

\t^^^^^^^^^^^^^^^[7]修改职工信息^^^^^^^^^^^^^^^^^\n"

\t^^^^^^^^^^^^^^^[8]保存数据^^^^^^^^^^^^^^^^^\n"

\t^^^^^^^^^^^^^^^[0]退出系统^^^^^^^^^^^^^^^^^\n\n"

\t*★★★★★★★★★★★★★★★★★★★★★★★*\n"

voidbc(structworker*wo)

fwrite(wo,sizeof(structworker),1,fp);

voidadd()

intnumberTemp=0;

structworkertemp;

请输入要添加职工个数:

numberTemp);

for(i=0;

i<

numberTemp;

i++)

输入第%d个职工信息\n"

i+1);

姓名:

%s"

temp.name);

工号:

temp.ID);

所属部门:

temp.depa);

基本工资:

temp.salary1);

奖励工资:

temp.salary2);

补贴项目即金额:

temp.salary3);

扣除项目即金额:

&

temp.salary4);

wo[Number++]=temp;

//写入到数组

bc(&

temp);

//写入到文件

添加成功\n"

voidsee()

以下是全部职工\n"

\t姓名\t工号\t所属部门\t基本工资\t奖励工资\t补贴项目及金额\t扣款项目及金额\t总工资\n"

while(i<

Number)

\t%s\t%s\t%s\t%d\t\t%d\t\t%d\t\t%d\t\t%d\n"

wo[i].name,wo[i].ID,wo[i].depa,wo[i].salary1,wo[i].salary2,wo[i].salary3,wo[i].salary4,wo[i].salary1+wo[i].salary2+wo[i].salary3-wo[i].salary4);

voidsearch()

intn=0;

1按姓名查找\n"

2按工号查找\n"

3按部门查找\n"

n);

switch(n)

xmcz();

ghcz();

bmcz();

printf("

输入错误!

}

voidxmcz()//按姓名查找

请输入要查找职工姓名:

name);

for(i=0;

Number;

if(strcmp(name,wo[i].name)==0)

voidghcz()//按工号查找

charid[10];

请输入要查找工号:

id);

if(strcmp(id,wo[i].ID)==0)

voidbmcz()//按部门查找

chardepa[30];

inti=0;

请输入要查询的部门名称:

scanf("

depa);

system("

for(i=0;

{

if(strcmp(depa,wo[i].depa)==0)

}

voiddel()

1按姓名删除\n"

2按工号删除\n"

xmsc();

ghsc();

voidxmsc()//按姓名删除

intj=0;

请输入要删除的职工姓名:

for(j=i;

j<

Number-1;

j++)

wo[j]=wo[j+1];

Number--;

//将剩余数据写入文件擦除以前的数据

fwrite(&

wo[i],sizeof(structworker),1,fp);

删除成功;

voidghsc()//按工号删除

charid[60];

请输入要删除的职工工号:

if(strcmp(id,wo[i].ID)==0)

voidstatistics()

doublesum[100];

sum[i]=wo[i].salary1+wo[i].salary2+wo[i].salary3-wo[i].salary4;

%s的总工资为:

%f\n"

wo[i].name,sum[i]);

voidstatistic()//统计职工工资

1按工资段统计\n"

2按部门统计\n"

gzdtj();

bmtj();

voidgzdtj()//按工资段统计

{intsa1,sa2;

intn,m;

intsl[20]={0,0};

请输入要查询的工资段:

%d-%d"

sa1,&

sa2);

{n=sum[i]/1000;

if(n>

9)n=10;

{case0:

sl[0]++;

case1:

sl[1]++;

case2:

sl[2]++;

case3:

sl[3]++;

case4:

sl[4]++;

case5:

sl[5]++;

case6:

sl[6]++;

case7:

sl[7]++;

case8:

sl[8]++;

case9:

sl[9]++;

case10:

sl[10]++;

m=sa1/1000;

switch(m)

工资在1000以下的人数为%d\n"

sl[0]);

工资在1000到2000之间的人数为%d\n"

sl[1]);

工资在2000到3000之间的人数为%d\n"

sl[2]);

工资在3000到4000之间的人数为%d\n"

sl[3]);

工资在4000到5000之间的人数为%d\n"

sl[4]);

工资在5000到6000之间的人数为%d\n"

sl[5]);

工资在6000到7000之间的人数为%d\n"

sl[6]);

工资在7000到8000之间的人数为%d\n"

sl[7]);

工资在8000到9000之间的人数为%d\n"

sl[8]);

工资在9000到10000之间的人数为%d\n"

sl[9]);

工资在10000以上的人数为%d\n"

sl[10]);

voidbmtj()//按部门统计

floatsum=0;

sum=sum+wo[i].salary1+wo[i].salary2+wo[i].salary3-wo[i].salary4;

该部门的总工资为:

sum);

voidmodify()

intmode=0;

请选择修改查找方式\n"

1按姓名查找修改\n"

2按工号查找修改\n"

mode);

switch(mode)

xmxg();

ghxg();

voidxmxg()//按姓名修改

请输入要修改的职工姓名:

if(strcmp(name,wo[i].name));

else

请重新输入该职工信息"

wo[i].name);

wo[i].ID);

所属部门:

wo[i].depa);

wo[i].salary1);

wo[i].salary2);

wo[i].salary3);

扣款项目及金额:

wo[i].salary4);

//信息修改后重新更新文件里面的数据以保持数据一致性

voidghxg()//按工号修改

charid[30];

请输入要修改的职工工号:

i++

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 水产渔业

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1