C语言课程设计身份证信息管理软件样本.docx
- 文档编号:3114739
- 上传时间:2022-11-17
- 格式:DOCX
- 页数:14
- 大小:138.88KB
C语言课程设计身份证信息管理软件样本.docx
《C语言课程设计身份证信息管理软件样本.docx》由会员分享,可在线阅读,更多相关《C语言课程设计身份证信息管理软件样本.docx(14页珍藏版)》请在冰豆网上搜索。
C语言课程设计身份证信息管理软件样本
《C语言课程设计》
课程设计报告
题目
身份证信息管理软件
年级专业
级电子信息工程
完毕日期
年
6
月
17
日
1.课程设计目···········································3
2.分析与设计·············································3
3.核心代码清单············································5
4.设计中问题··········································14
5.课程设计总结··········································14
6.参照书目··············································14
1.课程设计目:
1)巩固和加深对C语言课程基本知识理解和掌握;
2)掌握和提高C语言编程和程序调试基本能力;
3)运用C语言进行基本软件设计,并掌握软件开发基本过程和基本办法以及良好编程风格;
4)掌握书写程序设计阐明书办法;
5)提高运用C语言解决实际问题能力。
2.分析与设计:
1)系统需求:
公民身份信息是国家最宝贵基本信息资源之一,是制定与实行各种政策和指引经济建设重要根据。
运用当代信息技术进行公民身份信息资源充分开发与运用,掌握人口信息动态变化,对于国家加强社会管理,实现社会信息化将起到积极推动作用。
对于增进社会主义当代化建设和经济体制改革、打击犯罪、以便群众、保护公民合法权益等都具备十分重要意义。
其建设最后目的是实现与国家其他关于公民信息系统实现互连互通,数据高度共享。
为建立国家公民个人信用体系,为国家经济建设和社会发展做出贡献。
因而,我想设计一种身份证信息管理软件,用于对省份正信息分类、管理和记录,从而以便公安机关和普通民众查询。
2)设计思路:
应用构造体对身份证信息进行添加、删除、查寻、修改、保存、记录和文献操作等。
3)综合任务:
本次训练需要编写一种身份证信息管理系统。
此系统可以完毕录入身份证信息、查询身份证信息、修改和删除身份证信息;录入信息后可记录有关(诸如一定年龄段人数等)信息,并将信息存储在文献中。
4)技术方案:
①建立身份证信息构造体链表;
②对ID_card文献打开、输入、关闭等操作;
③对ID_card文献读取、查找、记录等操作;
④对身份证姓名、年龄、出生年月等校验和正误判断;
⑤用switch函数控制各子程序调用;
⑥程序中应用指针、字符串、构造体嵌套、递归、函数调用等知识;
⑦应用库函数strcpy、strcmp、stnrcmp、switch等。
5)
身份证管理系统框架图如下所示:
6)测试数据截屏:
7)
详细设计阐明
①构造体:
structID_card
{charname[20];
charsex;
charnation[10];
intyear;
intmonth;
intday;
charaddr[80];
charnum;
structID_card*next;
};
②有关函数:
structID_card*creat()/*创立新信息函数*/
structID_card*insert(structID_card*head,structID_card*name)/*插入信息函数*/
structID_card*delete(structID_card*head,char*num)/*删除信息函数*/
structID_card*search_birth(structID_card*head,intbirthyear,intbirthmonth,intbirthday)/*通过出生日期寻找信息*/
structID_card*search_age(structID_card*head,intnow_age)/*通过年龄寻找信息*/
structID_card*search_name(structID_card*head,chars_name[20])/*通过姓名寻找信息*/
structID_card*count_age(structID_card*head,intage_s,intage_e)/*记录某一年龄段人数*/
structID_card*count_year(structID_card*head,birthyear)/*记录某一年出生人数*/
通过动态分派存储空间,建立链表并存储信息来建立通讯录。
3.核心代码清单:
include
#include
#defineLENsizeof(structID_card)
#defineYEAR
structID_card
{
charname[20];
charsex;
charnation[10];
intyear;
intmonth;
intday;
charaddr[150];
charnum[20];
structID_card*next;
};
intn;
structID_card*creat()
{
structID_card*head;
structID_card*p1,*p2;
n=0;
p1=p2=(structID_card*)malloc(LEN);
printf("Pleaseinputthename:
");
scanf("%s",&p1->name);
printf("\nPleaseinputthesex:
");
scanf("%s",&p1->sex);
printf("\nPleaseinputthenation:
");
scanf("%s",&p1->nation);
printf("\nPleaseinputthebirth-year:
");
scanf("%d",&p1->year);
printf("\nPleaseinputthebirth-month:
");
scanf("%d",&p1->month);
printf("\nPleaseinputthebirthday:
");
scanf("%d",&p1->day);
printf("\nPleaseinputtheaddress:
");
scanf("%s",&p1->addr);
printf("\nPleaseinputtheIDcard-number:
");
scanf("%s",&p1->num);
head=NULL;
while(p1->name!
=0)
{n=n+1;
if(n==1)
head=p1;
else
p2->next=p1;
p2=p1;
p1=(structID_card*)malloc(LEN);
printf("Pleaseinputthename:
");
scanf("%s",&p1->name);
printf("Pleaseinputthesex:
");
scanf("%c",&p1->sex);
printf("Pleaseinputthenation:
");
scanf("%s",&p1->nation);
printf("Pleaseinputthebirth-year:
");
scanf("%d",&p1->year);
printf("Pleaseinputthebirth-month:
");
scanf("%d",&p1->month);
printf("Pleaseinputthebirthday:
");
scanf("%d",&p1->day);
printf("Pleaseinputtheaddress:
");
scanf("%s",&p1->addr);
printf("PleaseinputtheIDcard-number:
");
scanf("%s",&p1->num);
}
p2->next=NULL;
return(head);
}
structID_card*insert(structID_card*head,structID_card*name)
{
structID_card*p1,*p2;
p1=(structID_card*)malloc(LEN);
printf("Pleaseinputthename:
");
scanf("%s",&p1->name);
printf("Pleaseinputthesex:
");
scanf("%s",&p1->sex);
printf("Pleaseinputthenation:
");
scanf("%s",&p1->nation);
printf("Pleaseinputthebirth-year:
");
scanf("%d",&p1->year);
printf("Pleaseinputthebirth-month:
");
scanf("%d",&p1->month);
printf("Pleaseinputthebirthday:
");
scanf("%d",&p1->day);
printf("Pleaseinputtheaddress:
");
scanf("%s",&p1->addr);
printf("PleaseinputtheIDcard-number:
");
scanf("%s",&p1->num);
p2=head;
if(head=NULL)
{
head=p1;
p1->next=NULL;
}
else
{
p2->next=p1;
p1->next=NULL;
}
return(head);
}
structID_card*delete(structID_card*head,charnum)
{
structID_card*p1,*p2;
if(head==NULL)
{
printf("Thesystemhasnoinformation!
\n");
return(head);
}
p1=head;
while(num!
=p1->num&&p1->next!
=NULL)
{
p2=p1;
p1=p1->next;
}
if(num==p1->num)
{
if(p1==head)
{
printf("Theidentityinformationtobedeletedis:
\n");
printf("Name:
%s\nSex:
%c\nNation:
%s\nBirth:
%dnian%dyue%dri\nAddress:
%s\nIDcardnumber:
%s\n",p1->name,p1->sex,p1->nation,p1->yea
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语言 课程设计 身份证 信息管理 软件 样本