版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
...wd......wd......wd...中北大學(xué)數(shù)據(jù)構(gòu)造課程設(shè)計(jì)說明書學(xué)生姓名周西財(cái)
學(xué)號(hào):0706054236
學(xué)院電子與計(jì)算機(jī)科學(xué)技術(shù)學(xué)院專業(yè)軟件工程
題目圖書借閱管理系統(tǒng)成績(jī)
指導(dǎo)教周海英2009年6設(shè)計(jì)目的通過設(shè)計(jì)掌握數(shù)據(jù)構(gòu)造課程中學(xué)到的根本理論和算法并綜合運(yùn)用于理論實(shí)際問題中,它是理論與實(shí)踐結(jié)合的重要過程.設(shè)計(jì)要求學(xué)會(huì)對(duì)實(shí)際問題定義相關(guān)數(shù)據(jù)構(gòu)造,并采用恰當(dāng)?shù)脑O(shè)計(jì)方法和算法解決問題,同時(shí)訓(xùn)練學(xué)生進(jìn)展復(fù)雜程序設(shè)計(jì)的技能和培養(yǎng)良好的程序設(shè)計(jì)習(xí)慣.人工管理圖書的手續(xù)繁索、效率低下給具有強(qiáng)烈時(shí)間觀念的管理人員帶來了諸多不便,學(xué)校圖書館缺少一套完善的圖書管理軟件,為了對(duì)圖書的管理方便,因此必須開發(fā)圖書管理系統(tǒng)。設(shè)計(jì)內(nèi)容和要求內(nèi)容:1)圖書管理(增加圖書、查詢圖書、刪除圖書、圖書借閱、還書);2)會(huì)員管理(增加會(huì)員、查詢會(huì)員、刪除會(huì)員、借書信息);要求:根據(jù)設(shè)計(jì)內(nèi)容建設(shè)相關(guān)數(shù)據(jù)的動(dòng)態(tài)鏈表存儲(chǔ)構(gòu)造3.本設(shè)計(jì)所采用的數(shù)據(jù)構(gòu)造采用兩條單鏈表,其頭結(jié)點(diǎn)分別為head、mhead的全局變量來存儲(chǔ)圖書信息和會(huì)員信息。其定義數(shù)據(jù)構(gòu)造如下:/*圖書信息構(gòu)造體*/typedefstructelem{ charbookid[5]; charbookname[50]; charbookauthor[20]; charbookmark[2]; charmemberid[4]; }elemtype;/*圖書鏈表結(jié)點(diǎn)構(gòu)造體*/typedefstructnode{ elemtypedata; structnode*next; }lnode,*linknode;/*會(huì)員信息構(gòu)造體*/typedefstructmemberelem{ charmemberid[4]; charmembername[20]; }memberelemtype;/*會(huì)員鏈表結(jié)點(diǎn)構(gòu)造體*/typedefstructmembernode{ memberelemtypedata; structmembernode*next; }mlnode,*mlinknode;4.功能模塊詳細(xì)設(shè)計(jì)圖書借閱管理系統(tǒng)圖書借閱管理系統(tǒng)圖書管理模塊會(huì)員管理模塊增加圖書查詢圖書刪除圖書圖書借閱還書增加會(huì)員查詢會(huì)員借書信息刪除會(huì)員4.1詳細(xì)設(shè)計(jì)思想系統(tǒng)啟動(dòng)時(shí),通過讀取文件完成對(duì)以head、mhead為表頭的單鏈表完成初始化。初始化后系統(tǒng)進(jìn)入系統(tǒng)菜單,其運(yùn)行界面如下:中選擇功能1時(shí),進(jìn)入圖書管理模塊,其運(yùn)行界面如下:中選擇功能2時(shí),進(jìn)入會(huì)員管理模塊,其運(yùn)行界面如下:為了實(shí)現(xiàn)上述功能,特定義以下函數(shù)原型,具體代碼參見源代碼局部:voidmain()/*入口*/voidinitallinfo()/*初始化圖書和會(huì)員鏈表*/voidwelform()/*系統(tǒng)總菜單*/voidprintbookinfo(linknodehead)/*輸出圖書信息函數(shù)*/voidaddbook()/*增加圖書模塊*/voidselect()/*按編號(hào)查詢圖書*/voiddelete()/*按編號(hào)刪除圖書*/voidborrow()/*借閱圖書*/voidreturnbook()/*還書*/voidbookmanagetitle()/*圖書管理二級(jí)菜單*/voidbookmanage()/*二級(jí)圖書管理功能選擇函數(shù)*/voidprintmemberinfo(mlinknodehead)/*輸出會(huì)員信息函數(shù)*/voidaddmember()/*增加會(huì)員模塊*/voidselectmember()/*按編號(hào)查詢會(huì)員*/voiddeletemember()/*按編號(hào)刪除會(huì)員*/voidmembermanagetitle()/*會(huì)員管理二級(jí)菜單*/voidmembermanage()/*二級(jí)會(huì)員管理功能選擇函數(shù)*/程序調(diào)試運(yùn)用數(shù)據(jù)如下:圖書初始數(shù)據(jù)表bookidbooknamebookauthorbookmarkmemberid0001sanguoyanyiluoguanzhongN00002hongloumengcaoxueqinN00003xiyoujiwuchengenY0010004shuihuzhuanshinaianN00005javascriptJoinN00006cprogromtanghaoqiangN00007liaozhaizhiyipusonglingY0070008jiabajinN00009richucaoyuY0030010nahanluxunN0會(huì)員信息表memberidmembername001zhouxicai002longqidong003lipengfei004gaopeng005chenwentang006yangminghao4.2源代碼main.c文件:#include<conio.h>#include"type.c"#include"init.c"#include"book.c"#include"member.c"/*系統(tǒng)總菜單*/voidwelform(){clrscr();printf("SYSTEMMAINMENU\n");printf("*****************************************\n");printf("*1:bookmanage*\n");printf("*---------------------------------------*\n");printf("*2:membermanage*\n");printf("*---------------------------------------*\n");printf("*0:quit*\n");printf("*****************************************\n");printf("\n\nPleaseinputorder:\n");}voidmain(){intch;initallinfo();/*初始化鏈表*/while(1){welform();scanf("%d",&ch);switch(ch){case1:bookmanage();break;case2:membermanage();break;case0:exit(0);default:printf("\nYouhavainputthewrongorder!\n");printf("Pressanykeyreturn.....");getchar();getchar();}}}BOOK.C文件:/*輸出圖書信息函數(shù)*/voidprintbookinfo(linknodehead){linknodep=head->next;clrscr();printf("Thebookinformationsare:\n\n");printf("%-7s%-20s%-15s%-6s%s\n","id","title","author","mark","borower");printf("**************************************************************\n\n");for(;p!=NULL;p=p->next)printf("%-7s%-20s%-15s%-6s%s\n",p->data.bookid,p->data.bookname,p->data.bookauthor,p->data.bookmark,p->data.memberid);printf("\nPressanykeyretrun...");getchar();getchar();}/*增加圖書模塊*/voidaddbook(){linknodep=(lnode*)malloc(sizeof(lnode));clrscr();printf("Addbooks....\n");printf("pleaseinputbookinfo:\n\n");printf("%-7s%-20s%-15s\n","id(4)","title","author");printf("*************************************************************\n");scanf("%s%s%s",p->data.bookid,p->data.bookname,p->data.bookauthor);p->data.bookmark[0]='N';p->data.bookmark[1]='\0';p->data.memberid[0]='0';p->data.memberid[1]='\0';p->next=head->next;head->next=p;printf("\n\nAddsuccess!\n");printf("\nPressanykeyretrun...");getchar();getchar();}/*按編號(hào)查詢圖書*/voidselect(){charid[5];linknodep;clrscr();p=head->next;printf("selectbookbyid.....\n\n");printf("Pleaseinputbookid:\n");scanf("%s",id);while(p!=NULL){if(strcmp(p->data.bookid,id)==0)break;elsep=p->next;}if(p==NULL)printf("\nThebooknotexit!\n");else{printf("\n%-7s%-20s%-15s%-3s%s\n","id","title","author","borowed","borower");printf("****************************************************************\n");printf("\n%-7s%-20s%-15s%-3s%s\n",p->data.bookid,p->data.bookname,p->data.bookauthor,p->data.bookmark,p->data.memberid);}printf("\nPressanykeyretrun...");getchar();getchar();}/*按編號(hào)刪除圖書*/voiddelete(){charid[5];linknodep,q;clrscr();p=head->next;q=head;printf("deletebookbyid....\n\n");printf("Pleaseinputbookid:\n");scanf("%s",id);while(p!=NULL){if(strcmp(p->data.bookid,id)==0)break;else{q=p;p=p->next;}}if(p==NULL)printf("\nThebookyouwanttodeletearenotexit!\n");else{q->next=p->next;free(p);printf("\nDeletesuccess!\n");}printf("\nPressanykeyretrun...");getchar();getchar();}/*借閱圖書*/voidborrow(){charid[5];charmid[4];linknodep;mlinknodeq;clrscr();printf("borrowbook....\n\n");do{p=head->next;printf("Pleaseinputbookid:\n");scanf("%s",id);while(p!=NULL){if(strcmp(p->data.bookid,id)==0)break;elsep=p->next;}if(p==NULL){printf("\nThebookdoesn'texit!pleaseinputitagain!\n\n");}}while(p==NULL);if(p!=NULL){do{q=mhead->next;printf("\nPleaseinputmemberid:\n");scanf("%s",mid);while(q!=NULL){if(strcmp(q->data.memberid,mid)==0)break;elseq=q->next;}if(q==NULL){printf("\nYouarenotmember!inputagain\n");}}while(q==NULL);if(q!=NULL&&(strcmp(p->data.bookmark,"Y"))!=0){strcpy(p->data.bookmark,"Y");strcpy(p->data.memberid,q->data.memberid);printf("\nsuccessed!\n");getchar();}else{printf("\n\nThebookhaveborrowed,pleasewaitafewdays...");getchar();}}printf("\n\nPressanykeyretrun...");getchar();}/*還書*/voidreturnbook(){charid[5];linknodep;clrscr();p=head->next;printf("returnbook....\n\n");printf("Pleaseinputbookid:\n");scanf("%s",id);while(p!=NULL){if(strcmp(p->data.bookid,id)==0)break;elsep=p->next;}if(p==NULL)printf("\nThebookyouwanttoreturnarenotexit!\n");else{strcpy(p->data.bookmark,"N");strcpy(p->data.memberid,"0");printf("\nsuccessed!\n");}printf("\nPressanykeyretrun...");getchar();getchar();}/*圖書管理二級(jí)菜單*/voidbookmanagetitle(){clrscr();printf("BOOKMANAGEMENU\n");printf("******************************************\n");printf("*1:Lookallbooks*\n");printf("*----------------------------------------*\n");printf("*2:Addbook*\n");printf("*----------------------------------------*\n");printf("*3:Selectbookbyid*\n");printf("*----------------------------------------*\n");printf("*4:Deletebookbyid*\n");printf("*----------------------------------------*\n");printf("*5:Borrowbook*\n");printf("*----------------------------------------*\n");printf("*6:Returnbook*\n");printf("*----------------------------------------*\n");printf("*0:Returntomainform*\n");printf("******************************************\n");printf("\nPleaseinputorder:\n");}voidbookmanage(){intch;while(1){bookmanagetitle();scanf("%d",&ch);if(ch==0)break;switch(ch){case1:printbookinfo(head);break;case2:addbook();break;case3:select();break;case4:delete();break;case5:borrow();break;case6:returnbook();break;case0:break;default:printf("\n\nYouhavainputthewrongorder!\n"); printf("Pressanykeyreturn.....");getchar();getchar();}}}MEMBER.C文件:/*輸出會(huì)員信息函數(shù)*/voidprintmemberinfo(mlinknodehead){mlinknodemp=head->next;clrscr();printf("Thememberinfomationsare....\n\n");printf("%-7s%s\n","id","name");printf("********************************************************\n\n");for(;mp!=NULL;mp=mp->next) printf("%-7s%s\n",mp->data.memberid,mp->data.membername);printf("\nPressanykeyretrun...");getchar();getchar();}/*增加會(huì)員模塊*/voidaddmember(){mlinknodep=(mlnode*)malloc(sizeof(mlnode));clrscr();printf("Addmember...\n");printf("pleaseinputmemberinfo:\n\n");printf("%-7s%s\n","id","name");printf("********************************************************\n");scanf("%s%s",p->data.memberid,p->data.membername);p->next=mhead->next;mhead->next=p;printf("\n\nAddsuccess!");printf("\nPressanykeyretrun...");getchar();getchar();}/*按編號(hào)查詢會(huì)員*/voidselectmember(){charid[4];mlinknodep;clrscr();printf("selectmemberbyid...\n\n");p=mhead->next;printf("Pleaseinputmemberid:\n");scanf("%s",id);while(p!=NULL){if(strcmp(p->data.memberid,id)==0)break;elsep=p->next;}if(p==NULL)printf("\nThemembernotexit!\n");else{printf("\n%-7s%s\n","id","name");printf("********************************************************\n\n");printf("%-7s%s\n",p->data.memberid,p->data.membername);}printf("\n\nPressanykeyretrun...");getchar();getchar();}/*按編號(hào)刪除會(huì)員*/voiddeletemember(){charid[4];mlinknodep,q;clrscr();printf("deletemember......\n\n");p=mhead->next;q=mhead;printf("Pleaseinputmemberid:\n");scanf("%s",id);while(p!=NULL){if(strcmp(p->data.memberid,id)==0)break;else{q=p;p=p->next;}}if(p==NULL)printf("\nThememberyouwanttodeletearenotexit!\n");else{q->next=p->next;free(p);printf("\nDeletesuccess!\n");}printf("\nPressanykeyretrun...");getchar();getchar();}/*會(huì)員管理二級(jí)菜單*/voidmembermanagetitle(){clrscr();printf("MEMBERMANAGEMENU\n");printf("******************************************\n");printf("*1:Lookallmemberinfo*\n");printf("*----------------------------------------*\n");printf("*2:Addmember*\n");printf("*----------------------------------------*\n");printf("*3:Selectmemberbyid*\n");printf("*----------------------------------------*\n");printf("*4:Deletememberbyid*\n");printf("*----------------------------------------*\n");printf("*0:Returntomainform*\n");printf("******************************************\n");printf("\nPleaseinputorder:\n");}voidmembermanage(){intch;while(1){membermanagetitle();scanf("%d",&ch);if(ch==0)break;switch(ch){case1:printmemberinfo(mhead);break;case2:addmember();break;
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 德育教育在小學(xué)語文教學(xué)中的實(shí)施策略
- 克和千克的認(rèn)識(shí)(說課稿)-2023-2024學(xué)年二年級(jí)下冊(cè)數(shù)學(xué)人教版
- 2024年滇人版初中信息技術(shù)七年級(jí)第9冊(cè)-第一單元走進(jìn)信息世界-4《因特網(wǎng)信息獲取》(說課稿)與教材分析2024年滇人版初中信息技術(shù)七年級(jí)第9冊(cè)
- 《番禺長(zhǎng)隆野生動(dòng)物園》研學(xué)旅行活動(dòng)策劃(說課稿)蒙滬版四年級(jí)下冊(cè)綜合實(shí)踐活動(dòng)
- 觀察物體《三》(說課稿)-2024-2025學(xué)年五年級(jí)下冊(cè)數(shù)學(xué)人教版
- 第9課《從百草園到三味書屋》說課稿 2024-2025學(xué)年統(tǒng)編版語文七年級(jí)上冊(cè)001
- 2025年度高速公路綠化養(yǎng)護(hù)委托服務(wù)合同3篇
- Module1 How to learn English Unit1 Lets try to speak English as much as possible. 說課稿 2024-2025學(xué)年外研版八年級(jí)英語上冊(cè)
- Unit 2 Lets talk teens Integrated Skills公開課說課稿-2024-2025學(xué)年高一上學(xué)期英語譯林版2020必修第一冊(cè)
- Unit 5 We're family (說課稿)-2024-2025學(xué)年外研版(三起)(2024)三年級(jí)上冊(cè)
- iatf16949應(yīng)急計(jì)劃評(píng)審報(bào)告
- DB14T 1850-2019 園林綠化種植土質(zhì)量標(biāo)準(zhǔn)
- 商業(yè)銀行高管問責(zé)制度
- 企業(yè)員工培訓(xùn)之風(fēng)險(xiǎn)管理與防范對(duì)策
- 水源熱泵操作規(guī)程
- 食材配送后續(xù)服務(wù)方案
- 鑄造工廠設(shè)備管理(共21頁(yè))
- 農(nóng)產(chǎn)品收購(gòu)臺(tái)賬(登記經(jīng)營(yíng)單位及個(gè)體經(jīng)營(yíng)者投售的農(nóng)產(chǎn)品
- 分紅保險(xiǎn)精算規(guī)定
- Proud-of-you中英文歌詞
- 基因的表達(dá)與調(diào)控.ppt
評(píng)論
0/150
提交評(píng)論