基于C語(yǔ)言的圖形用戶(hù)界面圖書(shū)管理系統(tǒng)含源代碼_第1頁(yè)
基于C語(yǔ)言的圖形用戶(hù)界面圖書(shū)管理系統(tǒng)含源代碼_第2頁(yè)
基于C語(yǔ)言的圖形用戶(hù)界面圖書(shū)管理系統(tǒng)含源代碼_第3頁(yè)
基于C語(yǔ)言的圖形用戶(hù)界面圖書(shū)管理系統(tǒng)含源代碼_第4頁(yè)
基于C語(yǔ)言的圖形用戶(hù)界面圖書(shū)管理系統(tǒng)含源代碼_第5頁(yè)
已閱讀5頁(yè),還剩35頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

綜合實(shí)驗(yàn)程序:圖書(shū)管理系統(tǒng)設(shè)計(jì)實(shí)驗(yàn)?zāi)康募皟?nèi)容實(shí)實(shí)驗(yàn)要求新進(jìn)圖書(shū)根本信息的輸入圖書(shū)根本信息的查詢(xún)對(duì)撤消圖書(shū)信息的刪除為讀者〔即借書(shū)人〕辦理注冊(cè),即添加讀者查詢(xún):所有圖書(shū)信息查詢(xún)、所有讀者信息查詢(xún)辦理借書(shū)手續(xù):即修改書(shū)籍的借閱狀態(tài),添加讀者的信息等辦理還書(shū)手續(xù):即修改書(shū)籍的借閱狀態(tài),刪除讀者的信息等系統(tǒng)設(shè)計(jì)方案系統(tǒng)結(jié)構(gòu)圖whilekey!=Esc)while(1)Add添加圖書(shū)}}i}}}用戶(hù)使用手冊(cè)級(jí)菜單示進(jìn)行操作實(shí)驗(yàn)步驟及核心代碼#include<bios.h>#include<stdlib.h>#include<string.h>/*動(dòng)態(tài)分配*//*strcmp(a1,a2);strcpy();*//*界面設(shè)計(jì)宏定義*/efinewcharT1[10]="NULL";charT2[10]="YES";charT3[10]="NO";/*鍵盤(pán)消息*/{intword;charbyte;{ekeyword}/*結(jié)構(gòu)體聲明*/typedefstructSTUDENT/*定義*/{charID[10];structSTUDENT*next;/*為創(chuàng)立鏈表所用,指向下一結(jié)點(diǎn)*/}STD;structbook/*定義*/{charbookID[5];charprice[10];charwritername[50];charlend[10];charreader[10];structbook*next2;/*為創(chuàng)立鏈表所用,指向下一結(jié)點(diǎn)*/};pfreevoidpeCreatbookppstructbookmallocsizeofstructbookpfreevoidpvoidErs(STD*h){STD*p=h,*q;while(p!=NULL){q=p;p=p->next;q}}voidErs1(structbook*h){structbook*p=h,*q;while(p!=NULL){q=p;pnextokq}}/*界面局部*/voidDialog(intx0,inty0,intiWidth,intiRow,char*sTitle,char*information[]){inti,j=0;windowxyiWidthxiRow+y0);textbackground(6);clrscr();window(x0,y0,x0+iWidth,iRow+4+y0);textbackground(WHITE);clrscr();/*復(fù)選框*/textcolor(RED);for(i=2;i<iWidth;i++){tchtchgotoxyiiRowputch;}for(i=2;i<4+iRow;i++){tchgotoxy(iWidth,i);putch(179);}gotoxy(iWidth,3);putch(180);gotoxy(iWidth,1);putch(191);gotoxy(iWidth,4+iRow);putch(217);textcolor(RED);cprintf("%s",sTitle);textcolor(0);for(i=4;i<=3+iRow;i++){icprintf("%s",information[j]);j++;}}voidxuanzhong(intT,intRow,intback_color,inttext_color,char*m,chark){if(k=='1')window(x1,y1,x1+w,y1+r+4);textbackground(back_color);textcolor(text_color);cprintf("%s",m);}voidfuxuankuang(intx0,inty0,intw0,intr0,char*m1,char*m2){inti;textbackground(6);clrscr();textcolor(0);cprintf("%s",m1);cprintf("%s",m2);gotoxywr}/*添加讀者*/STD*Add1(STD*h){STD*p1,*p2,*p0,*p3;inti=1,j;while(i){tSTDpcprintf("inputreaderinformation(IDname)\r\n");cscanf("%s%s",p0->ID,p0->name);cprintf("\r\n");p2=h;p1=h->next;if(p1==NULL){h->next=p0;p0->next=NULL;}{while(p1&&strcmp(p0->ID,p1->ID)>0){}}cprintf("\r\n1.pressEscexit\r\n2.pressanykeytocontunieadd\r\n");j=get_key();clrscr();if(j==Esc)break;}returnh;}/*添加圖書(shū)*/structbook*Add2(structbook*h){structbook*p1,*p2,*p0,*p3;inti=1,j;while(i){eatbookpcprintf("inputbookinformation(IDbooknamepricewritername)\r\n");cscanf("%s%s%s%s",bookIDpbooknameppricepwriternamercpypreaderTstrcpyplendTnextif(p1==NULL){h->next2=p0;p0->next2=NULL;}{while(p1&&strcmp(p0->bookID,p1->bookID)>0)/*注意p1的位置*/{}}cprintf("\r\n1.pressEscexit\r\n2.pressanykeytocontunieadd\r\n");j=get_key();clrscr();if(j==Esc)break;}returnh;}/*讀者打印*/voidprintAll1(STD*h,structbook*h2){STD*p;inti=1,j=0;structbook*p1;p=h->next;if(!p)cprintf("nostudent\r\n");while(p){cprintf("%d:ID:%s,name:%s\r\n",i,p->ID,p->name);hilep{if(strcmp(p->ID,p1->reader)==0){j=1;cprintf("bookname:%s,ID:%s,price:%s,writername:%s\r\n",booknamepbookIDppricepwritername}}if(!j)cprintf("noborrow\r\n");p=p->next;i++;j=0;}cprintf("\r\npressanykeytocontunie\r\n");clrscr();}/*圖書(shū)打印*/voidprintAll2(structbook*h){structbook*p;inti=1;nextif(!p)cprintf("nobookinformation\r\n");while(p){cprintf("%d:ID:%s,bookname:%s,price:%s,writername:%s,lend:%s\r\n",i,p->bookID,p->bookname,p->price,p->writername,p->lend);p=p->next2;i++;}cprintf("\r\npressanykeytocontunie\r\n");clrscr();}/*查找讀者*/DSearchSTDhstructbookh{charxuehao[5],m;STD*p;intj=0;structbook*p1;ile{cprintf("inputreaderinformation(ID):");cscanf("%s",xuehao);cprintf("\r\n");p=h->next;while(p){if(strcmp(p->ID,xuehao)==0)break;p=p->next;}if(!p){cprintf("noinformation\r\n");}{cprintf("ID:%s,name:%s\r\n",p->ID,p->name);hilep{if(strcmp(p->ID,p1->reader)==0){j=1;cprintf("bookname:%s,ID:%s,price:%s,writername:%s\r\n",booknamepbookIDppricepwritername}}if(!j)cprintf("noborrow\r\n");}cprintf("\r\n1.pressEscexit\r\n2.pressanykeytocontuniesearch\r\n");j=get_key();clrscr();if(j==Esc)break;}}/*查找圖書(shū)*/structbook*Search2(structbook*h){charxuehao[5],m;structbook*p;intj;ile{cprintf("inputbookinformation(ID):");cscanf("%s",xuehao);nextwhile(p){if(strcmp(p->bookID,xuehao)==0)break;xt}if(!p)cprintf("noinformation\r\n");}{gotoxy(1,2);cprintf("ID:%s,bookname:%s,price:%s,writername:%s,lend:%s\r\n",p->bookID,p->bookname,p->price,p->writername,p->lend);}cprintf("\r\n1.pressEscexit\r\n2.pressanykeytocontunieadd\r\n");j=get_key();clrscr();if(j==Esc)break;}}/*刪除讀者*/{STD*p1,*p2,*p0,*p3;intj;{tSTDpcprintf("inputreaderinformation(ID):");cscanf("%s",p0->ID);p2=h;p1=h->next;if(p1==NULL){cprintf("\r\nnoinformation\r\n");cprintf("pressanykeytoexit\r\n");break;}{whilep1){if(strcmp(p1->ID,p0->ID)==0)break;}if(!p1){cprintfrnpressEscexit\r\n2.pressanykeytocontunieshanchu\r\n");j=get_key();clrscr();if(j==Esc)break;}{cprintf("thestudentinformationhavedeleted\r\n");cprintf("\r\n1.pressEscexit\r\n2.pressanykeytocontunieshanchu\r\n");j=get_key();clrscr();if(j==Esc)break;}}}returnh;}/*刪除圖書(shū)*/structbook*shanchu2(structbook*h){structbook*p1,*p2,*p0,*p3;intj;{eatbookpcprintf("inputbookinformation(ID):");cscanf("%s",p0->bookID);nextif(p1==NULL){cprintf("\r\nnoinformation\r\n");cprintf("pressanykeytoexit\r\n");}{whilep1){if(strcmp(p1->bookID,p0->bookID)==0)break;}if(!p1){cprintfrnpressEscexit\r\n2.pressanykeytocontunieshanchu\r\n");j=get_key();clrscr();if(j==Esc)break;}{cprintf("thebookinformationhavedeleted\r\n");cprintf("\r\n1.pressEscexit\r\n2.pressanykeytocontunieshanchu\r\n");j=get_key();clrscr();if(j==Esc)break;}}}returnh;}/*借書(shū)與還書(shū)*/voidborrow(STD*h,structbook*h2,chark){charxuehao[10],m;STD*p;inti=1,j;structbook*p2;while(i){cprintf("inputreaderinformation(ID):");cscanf("%s",xuehao);cprintf("\r\n");p=h->next;while(p){if(strcmp(p->ID,xuehao)==0)break;p=p->next;}if(!p){cprintf("nothisreader\r\n1pressEsctoexit\r\n2.pressanykeytocontinueborrow\r\n");j=get_key();clrscr();if(j==Esc)i=0;}{hile{cprintf("inputthebookID:");cscanf("%s",xuehao);cprintf("\r\n");hilep{if(strcmp(p2->bookID,xuehao)==0)break;}if(!p2){again\r\n");j=get_key();if(j==Esc){i=0;clrscr();break;}}{if(k=='1'){if(strcmp(p2->reader,T1)!=0){cprintf("haveborrowedbyother\r\n1.pressEscexit\r\n2.pressanykeytocontunieborrow\r\n");j=get_key();if(j==Esc)i=0;clrscr();}{cprintf("borrowover\r\n");cprintf("\r\n1.pressEscexit\r\n2.pressanykeytocontunieborrow\r\n");strcpy(p2->lend,T2);strcpy(p2->reader,p->ID);j=get_key();if(j==Esc)i=0;clrscr();}}elseif(k=='2'){cprintf("returnover\r\n");cprintf("\r\n1.pressEscexit\r\n2.pressanykeytocontuniereturn\r\n");strcpy(p2->lend,T3);j=get_key();if(j==Esc)i=0;clrscr();}break;}}}}}/*二進(jìn)制存盤(pán)*/kh{FILE*fw;charfname[20];STD*p,*p0;structbook*p2,*p1;cprintf("inputfilename:");cscanf("%s",&fname);cprintf("\r\n");fw=fopen(fname,"wb");if(!fw){cprintf("failed\r\npressanykeytogo\r\n");get_key();clrscr();return;}nextif(p==NULL&&p2==NULL){printf("noinformation\r\npressanykeytogo\r\n");get_key();fclose(fw);DeletSTD(p);return;}while(p!=NULL){ritepsizeofSTDfwp0=p;p=p->next;}while(p2!=NULL){}cprintf("over\r\npressanykeytogo\r\n");get_key();clrscr();}/*主函數(shù)*/voidmain(){inti=1,key,ji=0,jk=1,ot=1;char*buf;char*sTitle="LibaryMIS";char*information[]={"1.Add"2.All>",>",>",>","5.Borrow&Return>",e"7.Help","8.Exit"};char*m[]={"1.addreader","2.addbook","1.Allreader","2.Allbook","1.searchreader","2.searchbook","1.shanchureader","2.shanchubook","1.borrow","2.return"};STD*h1;structbook*h2;CreatSTD(h1);h1->next=NULL;Creatbook(h2);h2->next2=NULL;while(ot){jk=1;textbackground(WHITE);clrscr();textcolor(0);Dialog(x1,y1,w,r,sTitle,information);buf=(char*)malloc((w2+1)*3*2);xuanzhong(w,3+i,2,14,information[i-1],'1');wxyxwyr{if(key==Down){xuanzhong(w,3+i,WHITE,0,information[i-1],'1');if(i==r)i=1;xuanzhong(w,3+i,2,14,information[i-1],'1');}if(key==Up){xuanzhong(w,3+i,WHITE,0,information[i-1],'1');if(i==1)i=r;xuanzho

溫馨提示

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

最新文檔

評(píng)論

0/150

提交評(píng)論