數據結構通訊錄管理系統(tǒng)課程設計報告_第1頁
數據結構通訊錄管理系統(tǒng)課程設計報告_第2頁
數據結構通訊錄管理系統(tǒng)課程設計報告_第3頁
數據結構通訊錄管理系統(tǒng)課程設計報告_第4頁
數據結構通訊錄管理系統(tǒng)課程設計報告_第5頁
已閱讀5頁,還剩15頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、課程設計(大作業(yè))報告課程名稱: 數據結構 設計題目: 通訊錄信息管理系統(tǒng) 院 系: 信息技術學院 班 級: 12級計算機2班 設 計 者: * 學 號: 2 指導教師: SSSSSS 設計時間:2013.12.282013.12.31昆明學院課程設計(大作業(yè))任務書姓 名:* 院(系): 信息技術學院專 業(yè):計算機科學與技術學 號: 2任務起止日期:2013/12/28課程設計題目:通訊錄信息管理系統(tǒng)課程設計要求:(1)通訊錄的建立 (2)通訊者的插入 (3)通訊者的刪除 (4)通訊者的查詢 (5)通訊錄表的輸出工作計劃及安排: 4小時 復習相關的課程設計所需的內容,提出要求、提供選題并檢索

2、資料、確定設計項目 8小時 數據類型定義、確定存儲結構、算法設計 10小時 算法實現(xiàn) 4小 時 編寫課程設計報告指導教師簽字 年 月 日 課程設計(大作業(yè))成績學號:2 姓名:* 指導教師:SSSSS課程設計題目:通訊錄信息管理系統(tǒng)總結:這個課題是設計一個通訊錄系統(tǒng),該通訊系統(tǒng)能夠較好的管理好我們的通訊錄記錄,也擁有比較完善的功能,但是該系統(tǒng)依舊有漏洞,此程序必須按照系統(tǒng)提示的操作來執(zhí)行,不然的話就會使程序進入死循環(huán),比如,如果我輸入字符串的長度過長的話,程序就會終止運行了,并且還沒有提示;后面的刪除模塊所用的方法是用空格替代,雖然可以刪除,但達不到理想的效果。在編寫過程中,我逐步的了解了程序

3、模塊化設計的思想含義。在整個程序設計的過程中語法的錯誤還是比較容易檢查的,但是對于那些邏輯思維的問題方面的缺陷不易查出,因此常常出現(xiàn)系統(tǒng)提示沒有錯誤但是仍然不能夠正常運行的境況,盡管有很多不足之處,但我在整個系統(tǒng)程序設計的過程中,我可以感受到自己對C語言有了一定的掌握,對整體的把握度也提高了很多。此外編程是一項高精度的工作,所以我們要有規(guī)范化,標準化的代碼編寫習慣,良好的編寫習慣,不但有助于代碼的糾錯,也有助于不同人員之間的協(xié)作。 我們還要有模塊化思維能力,模塊化思維就是編程任何一個功能模塊或函數的時候,要多想一些,不要局限在完成當前任務的簡單思路上,想想看該模塊是否可以脫離這個系統(tǒng)存在,是否

4、可以通過簡單的修改參數的方式在其他系統(tǒng)和應用環(huán)境下直接引用,這樣就能極大的避免重復性的工作。另外我們要重視程序的算法,在程序中,算法是靈魂,我們要努力學習各種先進的算法,提高自己的編程能力。指導教師評語:成績:填表時間:指導教師簽名:課程設計(大作業(yè))報告一、數據結構及算法描述1. 數據類型定義2. 說明主要變量含義3. 說明數據輸入的要求和格式-即輸入數據的類型、值的范圍及輸入的形式4. 輸出數據的類型、值的范圍及輸出的形式5. 確定存儲結構6. 編寫算法并實現(xiàn)二、程序測試并運行通過1. 測試與分析、記錄調試過程及結果1 添加通訊錄記錄顯示通訊錄記錄2 按姓名方式查找按電話方式查找插入通訊錄

5、記錄按姓名方式排序刪除通訊錄記錄按記錄保存文件2. 出現(xiàn)的問題、解決的方法、最終運行結果三、源程序#include "stdio.h"#include "stdlib.h"#include "string.h"#include "conio.h"#include "stdlib.h"#define null 0struct recordchar name20;char phone20;char adress40;char postcode10;char e_mail30;student500;s

6、truct LinkList struct record US; struct LinkList *next;a; struct LinkList *head=null;int num=0;FILE *fp;int menu_select();int adduser();int list();int search();int display();int add();int listbyname();int dele();int save();int exit();void main() system("cls"); for(;) switch(menu_select() c

7、ase 0:adduser();break; case 1:list();break; case 2:search();break; case 3:display();break; case 4:add();break; case 5:listbyname();break; case 6:dele();break; case 7:save();break; case 8:exit(0); menu_select() char s80; int a; system("color 2f"); printf("*_* press any key enter menu!

8、*_* n"); getch(); system("cls"); printf("t*MENU*n"); printf("t* | 0. 添加通訊錄記錄 | *n"); printf("t* | 1. 顯示通訊錄記錄 | *n"); printf("t* | 2. 按姓名方式查找 | *n"); printf("t* | 3. 按電話方式查找 | *n"); printf("t* | 4. 插入通訊錄記錄 | *n"); printf("

9、;t* | 5. 按姓名方式排序 | *n"); printf("t* | 6. 刪除通訊錄記錄 | *n"); printf("t* | 7. 按記錄保存文件 | *n"); printf("t* | 8. Quit | *n"); printf("t*n"); do printf("n Enter you choice(08):"); scanf("%s",s); a=atoi(s); while (a<0|a>8); return a;adduse

10、r() printf("ntt* 請輸入用戶信息 *n"); printf("ntt輸入姓名:"); scanf("%s",&); printf("ntt輸入電話號碼:"); scanf("%s",&studentnum.phone); printf("ntt輸入地址:"); scanf("%s",&studentnum.adress); printf("ntt輸入郵編:"); sc

11、anf("%s",&studentnum.postcode); printf("ntt輸入e-mail:"); scanf("%s",&studentnum.e_mail); num+; printf("ntt是否繼續(xù)添加?(Y/N):");if (getch()='y') adduser();return(0); list() int i; system("cls"); if(num!=0) printf("ntt* 以下為通訊錄所有信息*"

12、); for (i=0;i<num;i+) printf("ntt姓名: %s",); printf("ntt電話: %s",studenti.phone); printf("ntt地址: %s",studenti.adress); printf("ntt郵編: %s",studenti.postcode); printf("ntte-mail:%s",studenti.e_mail); printf("tt"); if (i+1<num

13、) printf("ntt_"); system("pause"); printf("ntt*"); else printf("ntt通訊錄中無任何紀錄"); printf("ntt按任意鍵返回主菜單:"); getch(); return(0);search() int mark=0; int i; int a=0; printf("ntt* 按姓名查找 *"); char name20; printf("ntt請輸入姓名:"); scanf("

14、;%s",name); for(i=a;i<num;i+) if (strcmp(,name)=0) printf("ntt* 以下是您查找的用戶信息 *"); printf("ntt姓名: %s",); printf("ntt電話: %s",studenti.phone); printf("ntt地址: %s",studenti.adress); printf("ntte-mail:%s",studenti.e_mail);

15、printf("ntt*"); mark+; if (i+1)<num) printf("ntt是否繼續(xù)查找相同名字的用戶信息:(y/n)"); if (getch()='y') a=i; continue; else return(0); else printf("ntt按任意鍵返回主菜單"); getch(); return(0); if(mark!=0) printf("ntt沒有相同姓名的用戶紀錄"); printf("ntt按任意鍵返回主菜單"); getch()

16、; return(0); else printf("ntt沒有相同姓名的用戶紀錄"); printf("ntt按任意鍵返回主菜單"); getch(); return(0); display()int mark=0;int i;int a=0;printf("ntt* 按電話查找 *");char phone10;printf("ntt請輸入電話號碼:");scanf("%s",phone);for(i=0;i<num;i+) if (strcmp(studenti.phone,phone

17、)=0) printf("ntt* 以下是您查找的用戶信息 *"); printf("ntt姓名: %s",); printf("ntt電話: %s",studenti.phone); printf("ntt地址: %s",studenti.adress); printf("ntte-mail:%s",studenti.e_mail); printf("ntt*"); printf("ntt按任意鍵返回主菜單:"); mark+;

18、 getch(); return(0); if (mark=0) printf("ntt沒有改用戶的信息"); printf("ntt按任意鍵返回主菜單"); getch(); return(0);return(0);add() int i; if (fp=fopen("student.bin","wb")=NULL) printf("ntt文件打開失敗"); for (i=0;i<num;i+) if (fwrite(&studenti,sizeof(struct record)

19、,1,fp)!=1) printf("ntt寫入文件錯誤!n"); printf("ntt* 請輸入用戶信息 *n"); printf("ntt輸入姓名:"); scanf("%s",&); printf("ntt輸入電話號碼:"); scanf("%s",&studentnum.phone); printf("ntt輸入地址:"); scanf("%s",&studentnum.a

20、dress); printf("ntt輸入郵編:"); scanf("%s",&studentnum.postcode); printf("ntt輸入e-mail:"); scanf("%s",&studentnum.e_mail); num+; printf("ntt是否繼續(xù)添加?(Y/N):"); if (getch()='y') adduser(); return(0); fclose(fp); printf("ntt通訊錄文件已保存")

21、; printf("ntt按任意鍵退出程序ntt"); exit(0); return(0);void deletebyphone()int i,j;int deletemark=0;char phone20; printf("ntt請輸入要刪除用戶電話號碼:"); scanf("%s",phone); if(num=0) printf("ntt對不起,文件中無任何紀錄"); printf("ntt按任意鍵返回主菜單"); getch(); return; for (i=0;i<num;i

22、+) if (strcmp(studenti.phone,phone)=NULL) printf("ntt以下是您要刪除的用戶紀錄:"); printf("ntt姓名: %s",); printf("ntt電話: %s",studenti.phone); printf("ntt地址: %s",studenti.adress); printf("ntte-mail:%s",studenti.e_mail); printf("ntt是否刪除?(y/n)"

23、); if (getch()='y') for (j=i;j<num-1;j+) studentj=studentj+1; num-; deletemark+; printf("ntt刪除成功"); printf("ntt是否繼續(xù)刪除?(y/n)"); if (getch()='y') deletebyphone(); return; else return; continue; if (deletemark=0) printf("ntt沒有該用戶的紀錄"); printf("ntt是否

24、繼續(xù)刪除?(y/n)"); if (getch()='y') deletebyphone(); return; void deletebyname()int a=0;int findmark=0;int j;int deletemark=0;int i;char name20; printf("ntt請輸入要刪除用戶姓名:"); scanf("%s",name);for (i=a;i<num;i+) if (strcmp(,name)=NULL) printf("ntt以下是您要刪除的用

25、戶紀錄:"); findmark+; printf("ntt_"); printf("ntt姓名: %s",); printf("ntt電話: %s",studenti.phone); printf("ntt地址: %s",studenti.adress); printf("ntte-mail:%s",studenti.e_mail); printf("ntt_"); printf("ntt是否刪除?(y/n)"); i

26、f (getch()='y') for (j=i;j<num-1;j+) studentj=studentj+1; num-; deletemark+; printf("ntt刪除成功"); if(i+1)<num) printf("ntt是否繼續(xù)刪除相同姓名的用戶信息?(y/n)"); if (getch()='y') a=i; continue; printf("ntt是否繼續(xù)刪除?(y/n)"); if (getch()='y') deletebyname(); ret

27、urn; if(i+1)<num) printf("ntt是否繼續(xù)刪除相同姓名的用戶信息?(y/n)"); if (getch()='y') a=i; continue; elsecontinue;if (deletemark=0)&&(findmark=0) printf("ntt沒有該用戶的紀錄"); printf("ntt是否繼續(xù)刪除?(y/n)"); if (getch()='y') deletebyphone(); return; return;else if (findmark!=0) printf("ntt沒有重名信息"); printf("nt

溫馨提示

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

評論

0/150

提交評論