




已阅读5页,还剩11页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
C 语言课程设计 课程设计报告课程设计报告 题 目 身份证信息管理软件 年级专业 2010 级电子信息工程 完成日期2011年6月17日 精品文档 2欢迎下载 目目 录录 1 课程设计目 的 3 2 分析与设 计 3 3 核心代码清 单 5 4 设计中的问 题 14 5 课程设计总 结 14 6 参考书 目 14 精品文档 3欢迎下载 精品文档 4欢迎下载 1 课程设计目的 1 巩固和加深对 C 语言课程的基本知识的理解和掌握 2 掌握和提高 C 语言编程和程序调试的基本能力 3 利用 C 语言进行基本的软件设计 并掌握软件开发的基本过程和基本方法以及良 好的编程风格 4 掌握书写程序设计说明书的方法 5 提高运用 C 语言解决实际问题的能力 2 分析与设计 1 系统需求 公民身份信息是国家最宝贵的基础信息资源之一 是制定与实施各种政策和指导经济 建设的重要依据 利用现代信息技术进行公民身份信息资源的充分开发与利用 掌握人口 信息的动态变化 对于国家加强社会管理 实现社会信息化将起到积极的推动作用 对于 促进社会主义现代化建设和经济体制改革 打击犯罪 方便群众 保护公民的合法权益等 都具有十分重要的意义 其建设的最终目标是实现与国家其它有关公民信息的系统实现互 连互通 数据高度共享 为建立国家公民个人信用体系 为国家经济建设和社会发展做出 贡献 因此 我想设计一个身份证信息管理软件 用于对省份正信息的分类 管理和统计 从而方便公安机关和普通民众的查询 2 设计思路 应用结构体对身份证信息进行添加 删除 查寻 修改 保存 统计和文件操作等 3 综合任务 本次训练需要编写一个身份证信息管理系统 此系统可以完成录入身份证信息 查询 身份证信息 修改和删除身份证信息 录入信息后可统计相关的 诸如一定年龄段的人数等 信 息 并将信息存储在文件中 4 技术方案 建立身份证信息结构体链表 对 ID card 文件的打开 输入 关闭等操作 对 ID card 文件的读取 查找 统计等操作 精品文档 5欢迎下载 对身份证姓名 年龄 出生年月等校验和正误的判断 用 switch 函数控制各子程序的调用 程序中应用指针 字符串 结构体嵌套 递归 函数调用等知识 应用库函数 strcpy strcmp stnrcmp switch 等 5 身份证管理系统的框架图如下所示 开始 欢迎界面 选择所需操作 4 寻找信息 2 添加信息 1 创建新系统 3 删除信息 5 统计信息 选择所需操 作 选号符合规定 选择所需统计操 作 选号符合规定选号符合规定 按年龄查找 按出生日期 按姓名查找 按年龄段 按出生年份 结束 是 是 是 否 否 否 精品文档 6欢迎下载 6 测试数据截屏 7 详细设计说明 结构体 struct ID card char name 20 char sex char nation 10 int year int month int day char addr 80 char num 精品文档 7欢迎下载 struct ID card next 相关函数 struct ID card creat 创建新信息函数 struct ID card insert struct ID card head struct ID card name 插入信息 函数 struct ID card delete struct ID card head char num 删除信息函数 struct ID card search birth struct ID card head int birthyear int birthmonth int birthday 通过出生日期寻找信息 struct ID card search age struct ID card head int now age 通过年龄寻找信 息 struct ID card search name struct ID card head char s name 20 通过姓名 寻找信息 struct ID card count age struct ID card head int age s int age e 统计某 一年龄段的人数 struct ID card count year struct ID card head birthyear 统计某一年出生的 人数 通过动态分配存储空间 建立链表并存储信息来建立通讯录 3 核心代码清单 include include define LEN sizeof struct ID card define YEAR 2011 struct ID card char name 20 char sex char nation 10 int year int month int day char addr 150 char num 20 struct ID card next 精品文档 8欢迎下载 int n struct ID card creat struct ID card head struct ID card p1 p2 n 0 p1 p2 struct ID card malloc LEN printf Please input the name scanf s printf nPlease input the sex scanf s printf nPlease input the nation scanf s printf nPlease input the birth year scanf d printf nPlease input the birth month scanf d printf nPlease input the birthday scanf d printf nPlease input the address scanf s printf nPlease input the IDcard number scanf s head NULL while p1 name 0 n n 1 if n 1 head p1 else p2 next p1 p2 p1 p1 struct ID card malloc LEN printf Please input the name scanf s printf Please input the sex scanf c printf Please input the nation scanf s printf Please input the birth year 精品文档 9欢迎下载 scanf d printf Please input the birth month scanf d printf Please input the birthday scanf d printf Please input the address scanf s printf Please input the IDcard number scanf s p2 next NULL return head struct ID card insert struct ID card head struct ID card name struct ID card p1 p2 p1 struct ID card malloc LEN printf Please input the name scanf s printf Please input the sex scanf s printf Please input the nation scanf s printf Please input the birth year scanf d printf Please input the birth month scanf d printf Please input the birthday scanf d printf Please input the address scanf s printf Please input the IDcard number scanf s p2 head if head NULL head p1 p1 next NULL else 精品文档 10欢迎下载 p2 next p1 p1 next NULL return head struct ID card delete struct ID card head char num struct ID card p1 p2 if head NULL printf The system has no information n return head p1 head while num p1 num p1 p1 next if num p1 num if p1 head printf The identity information to be deleted is n printf Name s nSex c nNation s nBirth d nian d yue d ri nAddress s nID card number s n p1 name p1 sex p1 nation p1 year p1 month p1 day p1 addr p1 num head p1 next else p2 next p1 next printf The identity information to be deleted is n printf Name s nSex c nNation s nBirth d nian d yue d ri nAddress s nID card number s n p1 name p1 sex p1 nation p1 year p1 month p1 day p1 addr p1 num free p1 else printf System does not have information on the ID number n 精品文档 11欢迎下载 return head struct ID card search age struct ID card head int now age int b year struct ID card p b year YEAR now age p head while strcmp p year b year 0 if strcmp p year b year 0 printf Name s nSex c nNation s nBirth d nian d yue d ri nAddress s nID card number s n p name p sex p nation p year p month p day p addr p num if p year b year return head struct ID card search name struct ID card head char s name 20 struct ID card p p head while strcmp p name s name 0 if strcmp p name s name 0 printf Name s nSex c nNation s nBirth d nian d yue d ri nAddress s nID card number s n p name p sex p nation p year p month p day p addr p num if p name s name return head void main struct ID card head name int birthyear birthmonth birthday now age age s age e char num 20 s name 20 精品文档 12欢迎下载 int a b c printf n printf Welcome to ID information management software n printf n printf Please select your operating n printf 1 Creat a new ID card information system n printf 2 Insert the information in the system n printf 3 Delete information in the system n printf 4 Search ID card information n printf 5 For statistical operations n scanf d printf n switch a case 1 head creat break case 2 head insert head name break case 3 printf Please enter the ID number to delete scanf s num head delete head num break break case 4 printf Please select the operation you need to search n printf 1 Search by date of birth n printf 2 Search by age n printf 3 Search by Name n scanf d printf n switch b case 2 printf Please input the age of the person looking for information scanf d printf n search age head now age break case 3 精品文档 13欢迎下载 printf nPlease input the name of the person looking for information scanf s s name printf n search name head s name break default printf Your operating errors n break case 5 printf Please enter the statistics you need to operate n printf 1 Statistics of a number of age n printf 2 Statistics the number of births in a year n scanf d printf n default printf Your operating errors n printf Thank you for your visit n 4 设计中的问题 由于链表的创建和文件操作上的课较少 加之程序设计时间较紧 上述源程序还有很 多不完善之处 上述原代码中 struct ID card count year struct ID card head birthyear struct ID card count age struct ID card head int age s int age e struct ID card search birth struct ID card head int birthyear int birthmonth int birthday 三个函数没有调试通过 寻找信息函数没有调试成功 在查找 时得到的信息不对 creat 函数运行还不是很完善 总之 在编写程序时遇到了很多问题 也有一些问题得到了解决 如在编写 insert 函数时开始输入不了数据 后来查找资料 用 malloc 函数开辟了一个空间 可以完成数据的输入 在编写程序时我还是学到了很多
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 护士培训心得体会模版
- 个人雇佣工资合同范例
- 住房和房东扣钱合同范例
- 医疗安全管理与医院文化融合
- 小学三年级语文上学期期末成绩分析自己总结模版
- 个人礼品合同范例
- 员工续签合同工作总结模版
- 健康数据助力医疗业务发展策略分析
- 区块链技术在全球供应链管理中的实际运用
- 工作总结演讲与辩论协会招新的工作总结模版
- 贵州水城宏源实业(集团)有限责任公司招聘笔试题库2024
- 14.促织《变形记》联读教学设计 2023-2024学年统编版高中语文必修下册
- 《大学英语四级强化教程》全套教学课件
- 重点镇评价标准
- 2023广州美术学院附属中等美术学校(广美附中)入学招生测试卷数学模拟卷
- 《民法典》培训系列课件:第三编 租赁合同
- 《DB32T 4028-2021常染色体STR基因座等位基因频率参数》
- 农村生活污水处理站运营维护方案
- 烟机设备操作工基础知识考试题库(浓缩500题)
- MOOC 金融学-湖南大学 中国大学慕课答案
- esc急性肺栓塞诊断和管理指南解读
评论
0/150
提交评论