计算机技术基础课程设计Word格式.docx

上传人:b****2 文档编号:15289883 上传时间:2022-10-29 格式:DOCX 页数:10 大小:42.10KB
下载 相关 举报
计算机技术基础课程设计Word格式.docx_第1页
第1页 / 共10页
计算机技术基础课程设计Word格式.docx_第2页
第2页 / 共10页
计算机技术基础课程设计Word格式.docx_第3页
第3页 / 共10页
计算机技术基础课程设计Word格式.docx_第4页
第4页 / 共10页
计算机技术基础课程设计Word格式.docx_第5页
第5页 / 共10页
点击查看更多>>
下载资源
资源描述

计算机技术基础课程设计Word格式.docx

《计算机技术基础课程设计Word格式.docx》由会员分享,可在线阅读,更多相关《计算机技术基础课程设计Word格式.docx(10页珍藏版)》请在冰豆网上搜索。

计算机技术基础课程设计Word格式.docx

通过对函数的调用、选择结构的使用以及文件方式的保存实现对人员信息的管理。

二、设计思路:

对单位人员的信息进行管理,人员信息包括姓名、性别、年龄、学历、职位、工资、健康状况等。

可对人员信息进行插入、删除、查找、修改等功能。

三、流程图:

N

Y

四、程序清单:

#include<

stdio.h>

string.h>

stdlib.h>

conio.h>

#defineN100

typedefstructemployee

{

intnum;

intposition;

charname[20];

charsex[2];

intcult;

intsalary;

intstate;

}ro;

roem[N];

voidmanage();

voidquery();

voidinput();

voiddisplay();

voidchange();

voiddel();

intchangeposition();

intchangecult();

intchangesalary();

intchangestate();

inttotal;

intp;

charpassword[10]="

05180104"

;

voidmain()

intchoice;

chars[10];

intflag=0;

intn=3;

do

{

printf("

Pleaseenterthepassword:

\n"

);

scanf("

%s"

s);

if(!

strcmp(s,password))

WELCOME!

!

\n\n\n"

flag=1;

break;

}

else

Entererror!

Pleaseenteragain:

n--;

}while(n>

0);

flag)

Byebye!

return;

}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"

\t\tWelcometothestaffmanagesystem!

\t\tPleasechooseyouroperatetype:

======================================================\n"

\t\t1ManageSystem\n"

\t\t2QuerySystem\n"

printf("

\t\t0Quit\n"

%d"

&

choice);

switch(choice)

case1:

manage();

case2:

query();

case0:

Thankyou!

exit(0);

default:

Pleaseenteragain!

:

return;

}while

(1);

voidmanage()

intchoicemanage;

charchoice='

y'

while(choice=='

||choice=='

Y'

\t\tWelcometothemanagesystem!

\t\t1Inputstaffinformation\n"

\t\t2Displaystaffinformation\n"

\t\t3Changestaffinformation\n"

\t\t4Delstaffinformation\n"

\t\t0Return\n"

choicemanage);

switch(choicemanage)

input();

display();

case3:

change();

case4:

del();

case0:

Byebye!

Goon?

(y/n)"

if(toupper(choice)=='

N'

||(choice)=='

n'

printf(“Enterend!

Anykeytoreturn!

getch();

voidinput()

FILE*fp;

inti=0;

charchoiceinput='

if((fp=fopen("

employee.txt"

"

w"

))==NULL)

while(choiceinput=='

||choiceinput=='

i++;

total++;

The%dthstaff:

i);

Pleaseenternumber:

em[i].num);

Pleaseenterposition:

1boardchairman 

2generalmanager 

3deputymanager\n"

4departmentmanager 

5engineer 

6assisstant\n"

7technologicalman 

8leader 

9staff\n"

em[i].position);

Pleaseentername:

em[i].name);

Pleaseentersex:

em[i].sex);

Pleaseentercult:

1expert 

2doctor 

3master 

4bachelor 

5other\n"

em[i].cult);

Pleaseentersalary:

em[i].salary);

Pleaseenterbodystate:

1good 

2general 

3bad\n"

em[i].state);

(y/n)\n"

choiceinput);

fwrite(&

em[i],sizeof(structemployee),1,fp);

if(toupper(choiceinput)=='

) 

fclose(fp);

Enterend!

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

当前位置:首页 > 党团工作 > 入党转正申请

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

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