【正文】
要求設一個通信錄由以下幾項數(shù)據(jù)信息構(gòu)成: 數(shù)據(jù)項 類型姓名 字符串地址 字符串郵政編碼 字符串電話號碼 字符串試為通信錄數(shù)據(jù)定義類型和定義通信錄變量,實現(xiàn)功能:存取、顯示、刪除記錄、查詢記錄等功能。顯示:可以以表格形式輸出所有通訊錄里的記錄刪除:輸入欲刪除的那個人的名字后,會自動刪除他(她)的記錄內(nèi)容 查詢:可以選擇用姓名、電話、地址三種方式查詢修改:輸入欲修改的那個人的名字后,再依次輸入編號、姓名、年齡、電話號碼、通訊地址、電子郵箱即可完成修改保存:,輸入文件名(帶后綴名)后,即可將通訊錄信息保存到文件課程設計名稱及內(nèi)容課程設計名稱:單項選擇題標準化考試系統(tǒng)設計內(nèi)容:設計并實現(xiàn)一個單項選擇題標準化考試系統(tǒng)。任務和要求功能要求:(1)用文件保存試題庫。(二)其它要求:(1)只能使用C/C++語言,源程序要有適當?shù)淖⑨專钩绦蛉菀组喿x(2)至少采用文本菜單界面(如果能采用圖形菜單界面更好)(3)學生可自動增加新功能模塊(視情況可另外加分)主要知識點l 面向?qū)ο蟪绦蛟O計方法l 界面制作,switch的應用。l 動態(tài)數(shù)組(鏈表)類模板。五、其他程序設計可在Microsoft VC++、Borland C++ Builder環(huán)境下進行。class inter { private: student st[35]。char name[20]。char tel_no[12]。char e_mail[40]。void del(char name[20])。void find2(char name[20])。void list2()。void read()。void format()。} void print(int i){coutback。R39。r39。else return 0。} coutinter a。char select1。switch(select1){ case 39。:cout(1)添加:”cout(2)刪除:”(3)修改:”請選擇:”select2。139。char address[100]。char post_code[7]。cout輸入學號:”no。cout輸入地址:”address。cout輸入郵編:”post_code。(no,name,address,tel_no,post_code,e_mail)。char back_add。if(back_add==39。||back_add==39。)goto top。break。239。cinname2。cout返回還是回到主菜單(T為退出,R為回到主菜單,不計大小寫):”。cinback_del。R39。r39。else goto bottom。case 39。:cout輸入需要修改人的姓名:”char name3[20]。if((name3))} goto top。break。case 39。:cout(1)根據(jù)姓名查找”cout(2)根據(jù)學號查找”請選擇: ”。switch(select3){ case 39。:char name4[20]。cinname4。cout返回還是回到主菜單(T為退出,R為回到主菜單,不計大小寫):”。cinback_f1。R39。r39。else goto bottom。case 39。:char no4[13]。cinno4。cout返回還是回到主菜單(T為退出,R為回到主菜單,不計大小寫):”。char back_f2。if(back_f2==39。||back_f2==39。)goto top。break。339。cout返回還是回到主菜單(T為退出,R為回到主菜單,不計大小寫):”。cinback_w。R39。r39。else goto bottom。case 39。:cout(1)按學號排序:”cout(2)按姓名排序:”請選擇:”。cinselect4。139。cout返回還是回到主菜單(T為退出,R為回到主菜單,不計大小寫):”。cinback。R39。r39。else goto bottom。case 39。:()。} break。cinback1。R39。r39。else goto bottom。case 39。:()。char back_r。if(back_r==39。||back_r==39。)goto top。break。639。char select5。if(select5==39。||select5==39。)()。} char back_f。if(back_f==39。||back_f==39。)goto top。break。for(int i=0。strcpy(st[i].address,address)。strcpy(st[i].name,name)。strcpy(st[i].post_code,post_code)。x=0。for(int i=0。strcpy(st[i].e_mail,“0”)。strcpy(st[i].no,“0”)。strcpy(st[i].tel_no,“0”)。if(x==0)couterror:輸入姓名錯誤!”int inter::correct(char name[30]){int x。i} char select。cinselect。139。char name1[30]。cinname1。cout修改成功!”輸入要修改的學號:”。cinno1。cout修改成功!”輸入要修改的地址:”。cinaddress1。cout修改成功!”輸入要修改的郵編:”。cinpost_code1。cout修改成功!”輸入要修改的電話號碼:”。cintel_no1。cout修改成功!”輸入要修改的E_MAIL:”。cine_mail1。cout修改成功!”return back()。} } //按學號查詢聯(lián)系人void inter::find1(char no[13]){ int x,y=1,z=1。iif(!strcmp(st[i].no,no)){x=i。}else y=0。}if(y==0)cout輸入的學號查找不到?。 眕rint(x)。for(int i=0。if(z==0)break。z=0。char name1[20]。cinname1。ifstream file(name1)。char no[120]。char address[120]。char tel_no[120]。int time=0。while(!()){for(int k=0。time=1。iif(no[i]==39。){ i++。j}} {}st[k].no[j]=no[i]。(line,120,39。)。time=2。i} (line,120,39。)。:39。for(int j=0。i++。time=3。i} (line,120,39。)。:39。for(int j=0。i++。time=4。iif(tel_no[i]==39。){i++。jst[k].tel_no[j]=tel_no[i]。(line,120,39。)。strcpy(post_code,line)。for(int i=0。n39。if(post_code[i]==39。){} i++。j}st[k].post_code[j]=post_code[i]。}}} } time=0。i} (line,120,39。)。:39。for(int j=0。i++。//寫入文件 void inter::write(){char name[20]。cinname。ofstream savefile(name)。i} {} ()。strcpy(st[j].no,st[j+1].no)。ifor(int j=0。char name[20]。char tel_no[12]。char e_mail[40]。strcpy(name,st[j].name)。strcpy(st[j+1].name,name)。} for(int k=0。strcpy(st[j+1].address,address)。strcpy(st[j].tel_no,st[j+1].tel_no)。strcpy(post_code,st[j].post_code)。strcpy(st[j+1].post_code,post_code)。strcpy(st[j].e_mail,st[j+1].e_mail)。{} if(x==1){ cout} } } //按姓名排序 void inter::list2(){for(int i=0。jif(strcmp(st[j].name,st[j+1].name)0){ char no[13]。char address[100]。char post_code[7]。strcpy(no,st[j].no)。strcpy(st[j+1].no,no)。strcpy(st[j].name,st[j+1].name)。strcpy(address,st[j].address)。k}} strcpy(st[j].address,st[j+1].address)。strcpy(tel_no,st[j].tel_no)。strcpy(st[j+1].tel_no,tel_no)。strcpy(st[j].post_code,st[j+1].post_code)。strcpy(e_mail,st[j].e_mail)。strcpy(st[j+1].e_mail,e_mail)。if(strcmp(st[k].no,“0”)){} if(x==1){} coutvoid inter::format(){} for(int i=0。strcpy(st[i].e_mail,“0”)。strcpy(st[i].no,“0”)。strcpy(st[i].tel_no,“0”)。這個課程設計,花費了我近兩個星期的時間,這也是因為書本不熟悉。它不僅是計算機程序設計的重要理論技術(shù)基礎,也在我們電子與信息專業(yè)的學習中占據(jù)著十分重要的地位。因為我們學習知識就是為了實踐。利用計算機來編寫程序,也讓我感受到了編程的樂趣,極大的激發(fā)了我的興趣。通過該題目的設計過程,可以培養(yǎng)學生結(jié)構(gòu)化程序設計的思想,加深對高級語言基本語言要素和控制結(jié)構(gòu)的理解,針對c語言中的重點和難點內(nèi)容進行訓練,獨立完成有一定工作量的程序設計任務,同時強調(diào)好的程序設計風格。關(guān)鍵字:信息;管理;實用AbstractDesigned for people to others the memory of information convenient, developed a set of “mail list management system” the design process of this subject, students can be structured programming ideas, deepen our understanding of the advanced language basic language elements and control the understanding of the structure, conduct training for emphasis and difficulty in C language, independently plete the program design has a certain work tasks, while emphasizing the good programming training in software engineering, improving the ability to solve practical : Information。practical目 錄 概述.........................................................................1 ..................................................................1 ..................................................................1 ..........................................................2 2 總體設計.....................................................................3 ............................................................3 ............................................................4 3詳細設計.....................................................................5 ..........................................................5 ................................................................8 4調(diào)試分析....................................................................19 .................................