C语言身份证管理软件整理Word文档下载推荐.docx

上传人:b****4 文档编号:18024421 上传时间:2022-12-13 格式:DOCX 页数:11 大小:64.12KB
下载 相关 举报
C语言身份证管理软件整理Word文档下载推荐.docx_第1页
第1页 / 共11页
C语言身份证管理软件整理Word文档下载推荐.docx_第2页
第2页 / 共11页
C语言身份证管理软件整理Word文档下载推荐.docx_第3页
第3页 / 共11页
C语言身份证管理软件整理Word文档下载推荐.docx_第4页
第4页 / 共11页
C语言身份证管理软件整理Word文档下载推荐.docx_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

C语言身份证管理软件整理Word文档下载推荐.docx

《C语言身份证管理软件整理Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《C语言身份证管理软件整理Word文档下载推荐.docx(11页珍藏版)》请在冰豆网上搜索。

C语言身份证管理软件整理Word文档下载推荐.docx

按年龄、出生日期等;

3.具备统计功能,能统计某年龄段的人数;

4.在此基础上,可进行文件操作。

#include<

stdio.h>

string.h>

#defineSIZE50

#defineLENGTHsizeof(structperson)

structperson

{charIDNumber[20]。

charname[20]。

charbirthday[15]。

charnation[10]。

charsex[10]。

charaddress[100]。

}per[SIZE]。

voidmain()

{

intinput(intn)。

voidedit(intn)。

voidadd(intn)。

voiddel(intn)。

voidprint()。

voidstatistic(intn)。

voidsave()。

printf("

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

)。

\t\t\tShenFenZhengXinXiGuanLiXiTong\n"

\t\t\t*************************************\n\t\t\t\t-------ShengDuoZhengWangZuXuanWuXuBin\n"

\n\t\t\t\t1.creatnewfile\n\n\t\t\t\t2.edittheinformation\n\n\t\t\t\t3.addpersons\n\n\t\t\t\t4.deletepersons\n\n\t\t\t\t5.printfinformation\n\n\t\t\t\t6.statisticpersons\n\n\t\t\t\t7.exit\n"

Pleaseinputyourchoice:

"

scanf("

%d"

&

c)。

switch(c)

{case1:

input(c)。

break。

case2:

edit(c)。

case3:

add(c)。

case4:

del(c)。

case5:

print(c)。

case6:

statistic(c)。

case7:

exit(c)。

default:

error\n"

}

}

intinput(intn)

{intj。

Howmanypersonsdoyouwanttoinput:

scanf("

n)。

if(n>

SIZE)

elseif(n<

=SIZE)

{for(j=0。

j<

n。

j++)

{printf("

Pleaseinputthe%dthperson'

sinformation\n"

j+1)。

IDNumber:

%s"

per[j].IDNumber)。

\n"

Thename:

per[j].name)。

printf("

Thebirthday:

per[j].birthday)。

Thenation:

per[j].nation)。

Sex:

per[j].sex)。

Theaddress:

per[j].address)。

save()。

voidedit(intn)

{inti,t,m。

charnum[20]。

FILE*fp。

if((fp=fopen("

per.txt"

"

rb"

))==NULL)

{printf("

cannotopenfile\n"

return。

for(m=0。

m<

m++)

fread(&

per[m],LENGTH,1,fp)。

Pleaseinputtheperson'

sIDNumber:

num)。

for(t=0。

t<

t++)

{if(strcmp(per[t].IDNumber,num)==0)i=t。

pleaseinputthe%dthperson'

sinformation"

i+1)。

TheIDNumber:

per[i].IDNumber)。

TheName:

per[i].name)。

per[i].birthday)。

per[i].nation)。

per[i].sex)。

TheAddress:

per[i].address)。

fwrite(&

per[i],LENGTH,1,fp)。

fclose(fp)。

voidadd(intn)

{inti,m,t。

if((fp=fopen("

per[t],LENGTH,1,fp)。

Howmanypersonsdoyouwanttoadd:

i)。

n=n+i。

if(n>

SIZE)printf("

else

for(m=n-i。

{printf("

pleaseinputaperson'

simformation:

per[m].IDNumber)。

per[m].name)。

per[m].birthday)。

per[m].nation)。

Sex"

per[m].sex)。

per[m].address)。

fwrite(&

fclose(fp)。

voiddel(intn)

{charName[20]。

inti,t,m。

FILE*fp。

if((fp=fopen("

rb+"

cannotopenthefile\n"

for(m=0。

fread(&

pleaseinputtheperson'

snamethatyouwanttodelete:

scanf("

Name)。

for(i=0。

i<

i++)

if(strcmp(per[i].name,Name)==0)t=i。

for(。

per[t].name!

='

\0'

per[t]=per[t+1]。

voidprint(intn)

{inti,t。

charName[20]。

snamewhoseimformatinyouwanttocook"

for(i=0。

{if(strcmp(per[i].name,Name)==0)t=i。

IDNumber:

%s\nname:

%s\nbirthday:

%s\nnation:

%s\nSex:

%s\naddress:

%s\n"

per[t].IDNumber,per[t].name,per[t].birthday,per[t].nation,per[t].sex,per[t].address)。

voidstatistic(intn)

{inta,b,i,total=0。

intc,age。

FILE*fp。

age=2010-c。

Pleaseinputtheagefromatob:

for(i=0。

%d,%d"

a,&

b)。

if(age>

=a&

&

age<

=b)

%s\nAge:

%d\nnation:

\naddress:

per[i].IDNumber,per[i].name,per[i].birthday,per[i].nation,per[i].sex,per[i].address)。

total=total+1。

voidsave()

wb"

for(j=0。

SIZE。

if(fwrite(&

per[j],LENGTH,1,fp)!

=1)

filewriteerror\n"

fclose(fp)。

1、主函数

2、录入函数

3、编辑函数截图

4、添加函数截图

5、删除函数截图

6、显示函数截图

7、统计函数截图

8、信息保存文件函数截图

1、录入信息截图

2、编辑信息截图

3、添加信息截图

4、删除信息截图

5、显示信息截图

6、统计信息截图

7、信息保存文件截图

1、对C语言的进一步学习认识

通过这次的身份证信息管理软件的设计,加深了我们对C语言的学习认识,在设计的过程中,我们对书本知识进一步加深学习。

2、锻炼搜索、查阅资料的能力

在编辑程序的同时又不理解不明白的地方都会利用网络进行搜索查阅资料。

3、团队合作精神

在整个程序设计的过程中,团队三人都是密切合作,并且各抒己见,最终把整个城编辑出来。

4、培养软件开发的兴趣

编辑程序过程中我们也感觉到软件开发中的乐趣,同组人员都有从事软件开发的打算。

物理与电子信息学院课程设计评定意见

指导教师评语

主要内容包括:

设计报告内容的完整性和完成情况、报告格式的规范性、通过课程设计取得的收获等。

成绩:

签名:

年 月 日

注:

本页与封面用A3纸套印成封面和封底,课程设计报告正文用A4纸打印然后装订

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

当前位置:首页 > 求职职场 > 简历

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

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