C语言课程设计身份证信息管理软件样本Word文件下载.docx
《C语言课程设计身份证信息管理软件样本Word文件下载.docx》由会员分享,可在线阅读,更多相关《C语言课程设计身份证信息管理软件样本Word文件下载.docx(14页珍藏版)》请在冰豆网上搜索。
![C语言课程设计身份证信息管理软件样本Word文件下载.docx](https://file1.bdocx.com/fileroot1/2022-11/17/a6599c75-9abe-425d-b4d4-e60dd6f42596/a6599c75-9abe-425d-b4d4-e60dd6f425961.gif)
3.核心代码清单·
5
4.设计中问题·
14
5.课程设计总结·
6.参照书目·
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<
stdio.h>
#include<
malloc.h>
#defineLENsizeof(structID_card)
#defineYEAR
{
charname[20];
charaddr[150];
charnum[20];
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);
\nPleaseinputthesex:
sex);
\nPleaseinputthenation:
nation);
\nPleaseinputthebirth-year:
%d"
year);
\nPleaseinputthebirth-month:
month);
\nPleaseinputthebirthday:
day);
\nPleaseinputtheaddress:
addr);
\nPleaseinputtheIDcard-number:
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);
Pleaseinputthesex:
%c"
Pleaseinputthenation:
Pleaseinputthebirth-year:
Pleaseinputthebirth-month:
Pleaseinputthebirthday:
Pleaseinputtheaddress:
PleaseinputtheIDcard-number:
}
p2->
next=NULL;
return(head);
}
structID_card*insert(structID_card*head,structID_card*name)
p1=(structID_card*)malloc(LEN);
p2=head;
if(head=NULL)
{
head=p1;
p1->
else
structID_card*delete(structID_card*head,charnum)
{
if(head==NULL)
printf("
Thesystemhasnoinformation!
\n"
return(head);
p1=head;
while(num!
=p1->
num&
&
next!
=NULL)
p1=p1->
next;
if(num==p1->
num)
{
if(p1==head)
{
printf("
Theidentityinformationtobedeletedis:
Name:
%s\nSex:
%c\nNation:
%s\nBirth:
%dnian%dyue%dri\nAddress:
%s\nIDcardnumber:
%s\n"
p1->
name,p1->
sex,p1->
nation,p1->
yea