C語言課程設(shè)計(jì)——身份證信息管理軟件_第1頁
C語言課程設(shè)計(jì)——身份證信息管理軟件_第2頁
C語言課程設(shè)計(jì)——身份證信息管理軟件_第3頁
C語言課程設(shè)計(jì)——身份證信息管理軟件_第4頁
C語言課程設(shè)計(jì)——身份證信息管理軟件_第5頁
已閱讀5頁,還剩10頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、C語言課程設(shè)計(jì)課程設(shè)計(jì)報(bào)告題 目身份證信息管理軟件年級(jí)專業(yè)2010級(jí)電子信息工程完成日期2011年6月17日目 錄1. 課程設(shè)計(jì)目的32. 分析與設(shè)計(jì)33核心代碼清單54. 設(shè)計(jì)中的問題145. 課程設(shè)計(jì)總結(jié)146. 參考書目141. 課程設(shè)計(jì)目的:1) 鞏固和加深對(duì)C語言課程的基本知識(shí)的理解和掌握;2) 掌握和提高C語言編程和程序調(diào)試的基本能力;3) 利用C語言進(jìn)行基本的軟件設(shè)計(jì),并掌握軟件開發(fā)的基本過程和基本方法以及良好的編程風(fēng)格;4) 掌握書寫程序設(shè)計(jì)說明書的方法;5) 提高運(yùn)用C語言解決實(shí)際問題的能力。2. 分析與設(shè)計(jì):1) 系統(tǒng)需求:公民身份信息是國家最寶貴的基礎(chǔ)信息資源之一,是制定

2、與實(shí)施各種政策和指導(dǎo)經(jīng)濟(jì)建設(shè)的重要依據(jù)。利用現(xiàn)代信息技術(shù)進(jìn)行公民身份信息資源的充分開發(fā)與利用,掌握人口信息的動(dòng)態(tài)變化,對(duì)于國家加強(qiáng)社會(huì)管理,實(shí)現(xiàn)社會(huì)信息化將起到積極的推動(dòng)作用。對(duì)于促進(jìn)社會(huì)主義現(xiàn)代化建設(shè)和經(jīng)濟(jì)體制改革、打擊犯罪、方便群眾、保護(hù)公民的合法權(quán)益等都具有十分重要的意義。其建設(shè)的最終目標(biāo)是實(shí)現(xiàn)與國家其它有關(guān)公民信息的系統(tǒng)實(shí)現(xiàn)互連互通,數(shù)據(jù)高度共享。為建立國家公民個(gè)人信用體系,為國家經(jīng)濟(jì)建設(shè)和社會(huì)發(fā)展做出貢獻(xiàn)。因此,我想設(shè)計(jì)一個(gè)身份證信息管理軟件,用于對(duì)省份正信息的分類、管理和統(tǒng)計(jì),從而方便公安機(jī)關(guān)和普通民眾的查詢。2) 設(shè)計(jì)思路:應(yīng)用結(jié)構(gòu)體對(duì)身份證信息進(jìn)行添加、刪除、查尋、修改、保存、

3、統(tǒng)計(jì)和文件操作等。3) 綜合任務(wù):本次訓(xùn)練需要編寫一個(gè)身份證信息管理系統(tǒng)。此系統(tǒng)可以完成錄入身份證信息、查詢身份證信息、修改和刪除身份證信息;錄入信息后可統(tǒng)計(jì)相關(guān)的(諸如一定年齡段的人數(shù)等)信息,并將信息存儲(chǔ)在文件中。4) 技術(shù)方案: 建立身份證信息結(jié)構(gòu)體鏈表; 對(duì)ID_card文件的打開、輸入、關(guān)閉等操作; 對(duì) ID_card 文件的讀取、查找、統(tǒng)計(jì)等操作; 對(duì)身份證姓名、年齡、出生年月等校驗(yàn)和正誤的判斷; 用switch函數(shù)控制各子程序的調(diào)用; 程序中應(yīng)用指針、字符串、結(jié)構(gòu)體嵌套、遞歸、函數(shù)調(diào)用等知識(shí); 應(yīng)用庫函數(shù)strcpy、strcmp、stnrcmp、switch等。開始(歡迎界面)

4、選擇所需操作4.尋找信息2.添加信息1.創(chuàng)建新系統(tǒng)3.刪除信息5.統(tǒng)計(jì)信息選擇所需操作 選號(hào)符合規(guī)定選擇所需統(tǒng)計(jì)操作選號(hào)符合規(guī)定選號(hào)符合規(guī)定按年齡查找按出生日期按姓名查找按年齡段按出生年份結(jié)束是是是否否否5) 身份證管理系統(tǒng)的框架圖如下所示:6) 測(cè)試數(shù)據(jù)截屏:7) 詳細(xì)設(shè)計(jì)說明 結(jié)構(gòu)體:struct ID_card char name20;char sex;char nation10;int year;int month;int day;char addr80;char num;struct ID_card *next; 相關(guān)函數(shù):struct ID_card *creat()/*創(chuàng)建新信息

5、函數(shù)*/struct ID_card *insert(struct ID_card *head,struct ID_card *name)/*插入信息函數(shù)*/struct ID_card *delete(struct ID_card *head,char * num)/*刪除信息函數(shù)*/struct ID_card *search_birth(struct ID_card *head,int birthyear,int birthmonth,int birthday)/*通過出生日期尋找信息*/struct ID_card *search_age(struct ID_card *head,in

6、t now_age)/*通過年齡尋找信息*/struct ID_card *search_name(struct ID_card *head,char s_name20)/* 通過姓名尋找信息*/struct ID_card *count_age(struct ID_card *head,int age_s,int age_e)/*統(tǒng)計(jì)某一年齡段的人數(shù)*/struct ID_card *count_year(struct ID_card *head,birthyear)/*統(tǒng)計(jì)某一年出生的人數(shù)*/通過動(dòng)態(tài)分配存儲(chǔ)空間,建立鏈表并存儲(chǔ)信息來建立通訊錄。3. 核心代碼清單:include #inc

7、lude #define LEN sizeof(struct ID_card)#define YEAR 2011struct ID_card char name20;char sex;char nation10; int year;int month;int day;char addr150;char num20;struct ID_card *next;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(

8、Please input the name:);scanf(%s,&p1-name);printf(nPlease input the sex:);scanf(%s,&p1-sex);printf(nPlease input the nation:);scanf(%s,&p1-nation);printf(nPlease input the birth-year:);scanf(%d,&p1-year);printf(nPlease input the birth-month:);scanf(%d,&p1-month);printf(nPlease input the birthday:);s

9、canf(%d,&p1-day);printf(nPlease input the address:);scanf(%s,&p1-addr);printf(nPlease input the IDcard-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=(struct ID_card *)malloc(LEN); printf(Please input the name:); scanf(%s,&p1-name); printf(Please

10、 input the sex:); scanf(%c,&p1-sex); printf(Please input the nation:); scanf(%s,&p1-nation); printf(Please input the birth-year:); scanf(%d,&p1-year); printf(Please input the birth-month:); scanf(%d,&p1-month); printf(Please input the birthday:); scanf(%d,&p1-day); printf(Please input the address:);

11、 scanf(%s,&p1-addr); printf(Please input the IDcard-number:); scanf(%s,&p1-num);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,&p1-name);printf(Please input th

12、e sex:);scanf(%s,&p1-sex);printf(Please input the nation:);scanf(%s,&p1-nation);printf(Please input the birth-year:);scanf(%d,&p1-year);printf(Please input the birth-month:);scanf(%d,&p1-month);printf(Please input the birthday:);scanf(%d,&p1-day);printf(Please input the address:);scanf(%s,&p1-addr);

13、printf(Please input the IDcard-number:);scanf(%s,&p1-num);p2=head;if(head=NULL)head=p1;p1-next=NULL;elsep2-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

14、!=p1-num&p1-next!=NULL)p2=p1;p1=p1-next;if(num=p1-num) if(p1=head)printf(The identity information to be deleted is:n);printf(Name:%snSex:%cnNation:%snBirth:%d nian %d yue %d rinAddress:%snID card number:%sn,p1-name,p1-sex,p1-nation,p1-year,p1-month,p1-day,p1-addr,p1-num);head=p1-next;else p2-next=p1

15、-next;printf(The identity information to be deleted is:n);printf(Name:%snSex:%cnNation:%snBirth:%d nian %d yue %d rinAddress:%snID card number:%sn,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);return(head);s

16、truct 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&p-next!=NULL)p=p-next;if(strcmp(p-year,b_year)=0)printf(Name:%snSex:%cnNation:%snBirth:%d nian %d yue %d rinAddress:%snID card number:%sn,p-name,p-sex,p-n

17、ation,p-year,p-month,p-day,p-addr,p-num);if(p-year!=b_year&p-next=NULL)printf(System does not have information about the age!n); return(head);struct ID_card *search_name(struct ID_card *head,char s_name20)struct ID_card *p;p=head;while(strcmp(p-name,s_name)!=0&p-next!=NULL)p=p-next;if(strcmp(p-name,

18、s_name)=0)printf(Name:%snSex:%cnNation:%snBirth:%d nian %d yue %d rinAddress:%snID card number:%sn,p-name,p-sex,p-nation,p-year,p-month,p-day,p-addr,p-num);if(p-name!=s_name&p-next=NULL)printf(System does not have information about the name!n); return(head);void main()struct ID_card *head,*name; int

19、 birthyear,birthmonth,birthday,now_age,age_s,age_e; char num20,s_name20;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);

20、printf(3.Delete information in the system.n);printf(4.Search ID card information.n);printf(5.For statistical operations.n);scanf(%d,&a);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(hea

21、d,* num);break;break;case 4:printf(Please select the operation you need to searchn);printf(1.Search by date of birthn);printf(2.Search by agen);printf(3.Search by Namen);scanf(%d,&b);printf(n);switch(b)case 2:printf(Please input the age of the person looking for information:);scanf(%d,&now_age);prin

22、tf(n);search_age(head,now_age);break;case 3: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.Statisti

23、cs of a number of age.n);printf(2.Statistics the number of births in a year.n);scanf(%d,&c);printf(n);default:printf(Your operating errors!n);printf(Thank you for your visit!n);4. 設(shè)計(jì)中的問題:由于鏈表的創(chuàng)建和文件操作上的課較少,加之程序設(shè)計(jì)時(shí)間較緊,上述源程序還有很多不完善之處。上述原代碼中,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(str

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論