您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 图书馆管理系统(C语言程序设计)
百度知道电脑/网络程序设计C/C++添加到搜藏已解决图书管理系统C语言设计(c#免入)悬赏分:100-解决时间:2010-6-2514:381、功能描述,新进图书基本信息的输入。2.图书基本信息的查询。3.对撤消图书信息的删除。4.为借书人办理注册。5.办理借书手续(非注册会员不能借书)。6.办理还书手续信息描述:有关该系统基本信息的描述,如:图书名称、图书编号、单价、作者、存在状态、借书人姓名、性别、学号等大一新生的课程设计,那个只能用C语言来做,拜托各位了,两天之后要上交,网上找的调试都不成功。记住一定要用C语言啊,千万不要用C++,调试成功后有悬赏分的问题补充:我的邮箱是g080166@sina.com各位大侠,答完后记得留自己的名字啊,这样我也好给分对了,是要在vc的系统编译提问者:g080166-五级最佳答案#includedos.h#includebios.h#includeconio.h#includestdio.h#includestdlib.h#includemath.h#includestring.h#defineLEFT0x4b00/*左*/#defineRIGHT0x4d00/*右*/#defineDOWN0x5000/*下*/#defineUP0x4800/*上*/#defineSPACE0x3920/*空格*/#defineESC0x011b/*ESC键*/#defineENTER0x1c0d/*回车键*/#defineBackspace0xe08/*擦除键*/#defineALT_B12288/*组合键ALT_B*/#defineALT_M12800/*组合键ALT_M*/#defineALT_H8960/*组合键ALT_H*/intkey;/*按键变量*/inttextx,texty;/*光标坐标,x行,y列*/structmenustruct/*菜单用的结构体*/{charname[10];/*主菜单名*/charstr[10][20];/*选项*/intn;/*选项数*/}ml[3];/*使用了3个,可根据需要增删*/typedefstructBookList/*书的结构体*/{charnum[20];/*图书编号*/charname[20];/*书名*/intprice;/*书的价格*/charperson[20];/*借阅人*/intyes;/*判断书是否存在或者已经借出,1存在,0借出*/structBookList*next;}Book;typedefstructMemberList/*会员的结构体*/{charname[20];/*会员的姓名*/charsex[2];/*会员的性别*/intage;/*会员的年龄*/structMemberList*next;}Member;charsave[4096];/*保存文本区域空间*//*charsav1[4096];*/charc[4096];/*清屏专用空间*/inti,j;/*常用变量*/voidMenu();/*初始化界面*/voidSelectitem();/*定义菜单*/voidDrawSelectitem();/*显示主菜单*/voidBlackText(intx,inty,char*z);/*选中菜单*/voidRedText(intx,inty,char*z);/*正常菜单*/voidRun();/*具体操作过程*/voidDrawMl(intn);/*显示下拉菜单*/voidMoveMl(intn,intx);/*菜单选项的控制*/voidEnter(intm,intn);/*菜单选项的具体功能*/voidBookAdd();/*添加图书*/voidBookConsult();/*图书查询*/voidBookDel();/*删除图书资料*/voidBookBorrow();/*借书*/voidBookReturn();/*还书*/voidMemberAdd();/*增加会员*/voidMemberConsult();/*查询会员*/voidMemberDel();/*删除会员*/voidMemberBook();/*查询会员借书信息*/voidHelp();/*帮助*/voidVer();/*版本信息*/voidClrScr();/*自定义清屏函数*/voidDrawFrame(intleft,intup,intright,intdown,inttextcolor,intbackgroundcolor);/*画边框*//***主函数****/voidmain(void){Menu();/*初始化界面*/Run();/*具体操作过程*/}/*初始化界面*/voidMenu(){system(cls);/*调用系统的清屏命令*/textbackground(BLUE);/*将背景设置为蓝色*/window(1,1,25,80);clrscr();textx=3;/*光标初始化位置*/texty=2;gotoxy(1,2);printf(%c,218);/*画左上角*/for(i=0;i78;i++)printf(%c,196);/*画水平直线*/printf(%c,191);/*画右上角*/for(i=3;i=23;i++){gotoxy(1,i);printf(%c,179);/*画垂直线*/gotoxy(80,i);printf(%c,179);}printf(%c,192);/*画左下角*/for(i=0;i78;i++)printf(%c,196);printf(%c,217);/*画右下角*/gotoxy(1,1);textcolor(7);/*设置灰色*/for(i=0;i80;i++)cprintf(%c,219);/*用符号实现画主菜单的灰色背景区*/Selectitem();/*调用选项函数*/DrawSelectitem();/*画选项*/gettext(2,3,78,23,c);/*保存当前文本区域*/}/*定义菜单*/voidSelectitem(){strcpy(ml[0].name,Book);/*下面的具体选项补空格是为了各菜单黑色背景相同*/strcpy(ml[0].str[0],Add);/*添加图书*/strcpy(ml[0].str[1],Find);/*查询图书*/strcpy(ml[0].str[2],Delete);/*删除图书资料*/strcpy(ml[0].str[3],Borrow);/*借书*/strcpy(ml[0].str[4],Return);/*还书*/strcpy(ml[0].str[5],Exit);/*退出系统*/ml[0].n=6;/*保存菜单的项数*/strcpy(ml[1].name,Member);strcpy(ml[1].str[0],Register);/*添加新会员*/strcpy(ml[1].str[1],Find);/*查询会员资料*/strcpy(ml[1].str[2],Delete);/*删除会员资料*/strcpy(ml[1].str[3],Member&book);ml[1].n=4;strcpy(ml[2].name,Help);/*系统帮助*/strcpy(ml[2].str[0],ThisSystem);strcpy(ml[2].str[1],Ver);ml[2].n=2;}/*显示主单名*/voidDrawSelectitem(){for(i=0;i3;i++)RedText(i,1,ml[i].name);/*显示主菜单名,且首字母为红色*/}/*正常显示菜单*/voidRedText(intx,inty,char*z){textbackground(7);/*设置背景颜色为浅灰色*/gotoxy(3+x*20,y);for(j=0;z[j];j++){if(j==0)textcolor(RED);/*第一个字母显示红色*/elsetextcolor(BLACK);/*设置黑色*/cprintf(%c,z[j]);/*输出菜单名*/}}/*显示选中菜单*/voidBlackText(intx,inty,char*z){textbackground(0);/*设置背景颜色为黑色*/textcolor(15);/*设置文本颜色为白色*/gotoxy(3+20*x,y);/*定位坐标*/cputs(z);/*输出菜单名字符串*/}/*按键操作过程*/voidRun(){while(1){gotoxy(texty,textx);key=bioskey(0);/*接收按键*/switch(key){caseALT_B:caseESC:DrawMl(0);break;/*显示下拉菜单1*/caseALT_M:DrawMl(1);break;/*显示下拉菜单2*/caseALT_H:DrawMl(2);/*显示下拉菜单3*/caseUP:/*上光标键的操作控制*/{if(textx==3)textx=23;textx--;gotoxy(texty,textx);}break;caseDOWN:/*下光标键的操作控制*/{if(textx==23)textx=3;textx++;gotoxy(texty,textx);}break;caseLEFT:/*左光标键的操作控制*/{if(texty==2)texty=79;texty--;gotoxy(texty,textx);}break;caseBackspace:/*擦除键的设置*/{if(texty==2&&textx==3)continue;else{if(texty!=2)texty--;/*擦除键的细节问题,先擦去东西,然后光标还要往后退一格*/elseif(texty==2){texty=78;textx--;}gotoxy(texty,textx);printf();gotoxy(texty,textx);}}break;/*endcase0xe08*/caseRIGHT:/*右光标键的操作控制*/{if(texty==79)texty=2;texty++;gotoxy(texty,textx);}break;caseSPACE:/*空格键的操作*/{if(texty==79)continue;else{gotoxy(texty,textx);/*空格的细节操作*/printf();texty++;gotoxy(texty,textx);}}break;caseENTER:/*回车的控制操作*/{if(textx==23)continue;textx++;texty=2;gotoxy(texty,textx);}break;default:/*非控制键的结果*/{if(texty==79&&textx==23)/*到达最后就不再输出*/continue;elseif(texty==79&&textx!=23)/*到行的最后*/{textx++;texty=2;}gotoxy(texty,textx);/*输出结果*/printf(%c,key);if(texty==79)/*如果texty==79就不执行*/continue;else/*如果没到行尾就继续执行,使光标向前移动一位*/texty++;}}}/*大循环的大括号*/}/*画边框函数*/voidDrawFrame(intl,intu,intr,intd,inttcolor,intbcolor){textbackground(bcolor);/*背景颜色*/textcolor(bcolor);/*文本颜色*/for(i=l;i=r;i++)/*输出背景区域*/{for(j=u;j=d;j++){gotoxy(i,j);printf(%c,219);/*输出背景字符*/}}textcolor(tcolor);/*边框颜色*/for(i=u+1;id;i
本文标题:图书馆管理系统(C语言程序设计)
链接地址:https://www.777doc.com/doc-6193128 .html