语言图书标准管理系统专业课程设计方案报告_第1页
语言图书标准管理系统专业课程设计方案报告_第2页
语言图书标准管理系统专业课程设计方案报告_第3页
语言图书标准管理系统专业课程设计方案报告_第4页
语言图书标准管理系统专业课程设计方案报告_第5页
已阅读5页,还剩23页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

第三章图书管理系统设计与实现3.1系统需求分析图书登记管理系统作为一种应用软件将为学校教师和学生提供一种对学校图书馆进一步理解并借阅、还书平台。依照系统界面提示信息对图书馆信息进行查询、初始化等操作系统功能需求分析描述如下:(1)系统主菜单:进入系统和退出系统(2)功能菜单:显示可以进行操作(3)查询主菜单:依照图书编号、书名、作者进行查询,并可显示所有图书信息(4)借还书主菜单:可以进行借书和还书等操作3.2系统设计3.2.1系统总统设计下面从系统整体流程功能模块、系统界面及数据构造进行总体设计。(1)总体思想本系统重要设计思想是实现图书馆功能机管理系统信息查询、借书、还书等重要功能。系统设计办法是构造化实际办法,系统用C语言进行开发顾客可以清晰理解图书馆内状况。(2)系统模块构造图依照需求分析成果,图书管理系统可以分为三大模块:查询图书模块、借书功能模块、还书功能模块。系统模块构造如图:图书管理系统图书管理系统还书功能系统借书功能系统图书管理主菜单图书查询系统还书功能系统借书功能系统图书管理主菜单图书查询系统3.2.2系统㈠系统主菜单。显示系统主菜单,里面有相应功能代码,依照选取各功能代码进入不同界面。功能重要涉及:退出系统、查询图书、借书、还书。㈡查询图书信息进入此菜单功能模块,输入您要查询图书编号、名字、作者等。 图书查询模块流程如图:开始开始提示输入图书编号、书名、作者输入对的查询否是重新输入是重新输入退出系统否退出系统3.3测试成果系统主界面功能菜单查询系统菜单借还系统菜单3.4源代码#include<stdio.h>#include<stdlib.h>#include<string.h>typedefstructlink{charnumber[100];charbookname[100];charauthor[100];charpublish[100];chartime[100];floatprice;charstatus[100];structlink*next;}link;link*Cbook(){intn=0;link*p,*q,*head;FILE*fp;fp=fopen("图书信息.txt","r+");if(fp==NULL)printf("没有找到文献,请检查……");p=(link*)malloc(sizeof(link));if(p==NULL)printf("申请内存出错!!!\n");fscanf(fp,"%s%s%s%s%s",p->number,p->bookname,p->author,p->publish,p->time);fscanf(fp,"%f",&p->price);fscanf(fp,"%s",p->status);while(feof(fp)==0){n++;if(n==1){ head=p;}else{q=p;p=(link*)malloc(sizeof(link));if(p==NULL)printf("申请内存出错!!!\n");fscanf(fp,"%s%s%s%s%s",p->number,p->bookname,p->author,p->publish,p->time);fscanf(fp,"%f",&p->price);fscanf(fp,"%s",p->status);q->next=p;}}p->next=NULL;fclose(fp);printf("信息已录入!!!");returnhead;}voidmainmenu(){printf("\n*****************************************\n");printf("\n**欢迎使用图书管理系统**\n");printf("\n**1.进入系统0.退出系统**\n");printf("\n*****************************************\n");printf("\n请选取");}voidmenu1(){printf("\n*****************************************\n");printf("\n**1.进入图书查询系统**\n");printf("\n**2.进入图书借还系统**\n");printf("\n**3.保存所有图书信息**\n");printf("\n**4.返回上级菜单**\n");printf("\n*****************************************\n");printf("\n请选取");}voidcxmenu(){printf("\n*****************************************\n");printf("\n**1.显示所有图书信息**\n");printf("\n**2.按编号查询图书**\n");printf("\n**3.按书名查询图书**\n");printf("\n**4.按作者查询图书**\n");printf("\n**5.返回上级菜单**\n");printf("\n****************************************\n");printf("\n请选取");}voidjhmenu(){printf("\n*****************************************\n");printf("\n**1.借书**\n");printf("\n**2.还书**\n");printf("\n**3.返回上级菜单**\n");printf("\n*****************************************\n");printf("\n请选取"); }voidprint(link*head){ link*p; p=head; printf("\n"); printf("\n**************************************************\n"); printf("\n编号\t\t书名\t\t作者\t\t出版社\t\t出版时间\t\t价格\t\t状态\n"); while(p!=NULL) { printf("\n"); printf("%s\t%s\t%s\t%s\t%s",p->number,p->bookname,p->author,p->publish,p->time); printf("\t\t%.2f",p->price); printf("\t\t%s",p->status); printf("\n"); p=p->next; }}voidhold(link*head){link*p;FILE*fp;fp=fopen("图书信息.txt","w+");if(fp==NULL){printf("文献操作出错!!!");exit(1); }p=head;for(;p!=NULL;p=p->next){ fprintf(fp,"%s\t%s\t%s\t%s\t%s",p->number,p->bookname,p->author,p->publish,p->time); fprintf(fp,"\t\t%.2f",p->price); fprintf(fp,"\t\t%s",p->status); fprintf(fp,"\n"); }fclose(fp);printf("信息已保存。");}voidholdcx(link*t){ link*p=NULL; FILE*fp; fp=fopen("查询.txt","a+"); p=t; fprintf(fp,"查询到信息为:\n"); fprintf(fp,"\n"); fprintf(fp,"\n**************************************************\n"); fprintf(fp,"\n编号\t\t书名\t\t作者\t\t出版社\t\t出版时间\t\t价格\t\t状态\n"); fprintf(fp,"\n"); fprintf(fp,"%s\t%s\t%s\t%s\t%s",p->number,p->bookname,p->author,p->publish,p->time); fprintf(fp,"\t\t%.2f",p->price); fprintf(fp,"\t\t%s",p->status); fprintf(fp,"\n"); fclose(fp); printf("信息已保存!!!");}link*findnumber(link*head){charkey[100];link*h,*t1=NULL;printf("请输入图书编号:");getchar();gets(key);for(h=head;h!=NULL;h=h->next){if(strcmp(key,h->number)==0){ t1=h; break;}}returnt1;}link*findboookname(link*head){charkey[100];link*h,*t2=NULL;printf("请输入图书书名:");getchar();gets(key);for(h=head;h!=NULL;h=h->next){if(strcmp(key,h->bookname)==0){ t2=h; break;}}returnt2;}link*findauthor(link*head){charkey[100];link*h,*t3=NULL;printf("请输入作者姓名:");getchar();gets(key);for(h=head;h!=NULL;h=h->next){if(strcmp(key,h->author)==0){ t3=h; break;}}returnt3;}link*sortnumber(link*head){ link*p,*q,*temp;temp=(link*)malloc(sizeof(link));if(temp==NULL){ printf("申请内存出错!!!"); exit(1);} for(p=head;p!=NULL;p=p->next) {for(q=p->next;q!=NULL;q=q->next) { if(strcmp(p->number,q->number)>0) { strcpy(temp->number,p->number); strcpy(temp->bookname,p->bookname); strcpy(temp->author,p->author); strcpy(temp->publish,p->publish); strcpy(temp->time,p->time); temp->price=p->price; strcpy(temp->status,p->status); strcpy(p->number,q->number); strcpy(p->bookname,q->bookname); strcpy(p->author,q->author); strcpy(p->publish,q->publish); strcpy(p->time,q->time); p->price=q->price; strcpy(p->status,temp->status); strcpy(q->number,temp->number); strcpy(q->bookname,temp->bookname); strcpy(q->author,temp->author); strcpy(q->publish,temp->publish); strcpy(q->time,temp->time); q->price=temp->price; strcpy(q->status,temp->status); } } }returnhead;}link*borrowbook(link*head){ link*h,*p; charch,ch1[100]="在库",ch2[100]="不在库"; h=head; printf("\n**************************************************\n"); printf("\t\t欢迎使用借书系统!!!\n"); p=findboookname(h); if(p==NULL) printf("借书失败,书库中没有这本书!!!"); elseif(strcmp(p->status,ch2)==0) printf("借书失败,图书不在库!!!"); else { printf("确认借出?Y/N:"); scanf("%c",&ch); getchar(); if(ch=='Y'||ch=='y') { strcpy(p->status,ch2); printf("借书成功,请返回上级菜单保存信息!!!"); } if(ch=='N'||ch=='n') { printf("你没有借任何书!!!"); } }returnhead;}link*returnbook(link*head){ link*h,*p; charch,ch1[100]="在库",ch2[100]="不在库"; h=head; printf("\n**************************************************\n"); printf("\t\t欢迎使用还书系统!!!\n"); p=findboookname(h); if(p==NULL) printf("还书失败,这不是本书库书!!");else{ printf("确认还书?Y/N:"); scanf("%c",&ch); getchar(); if(ch=='Y'||ch=='y') { strcpy(p->status,ch1); printf("还书成功,请返回上级菜单保存信息!!!"); } if(ch=='N'||ch=='n') { printf("你没有还书!!!"); }} returnhead;}voidmain(){inta,b,c,d;link*h,*t;L:system("cls");mainmenu();while(1){scanf("%d",&a);switch(a){case1:{B:system("cls");menu1();while(1){ scanf("%d",&b); switch(b) { case1: { system("cls"); cxmenu(); while(1) { scanf("%d",&c); switch(c) { case1: { print(h); }break;case2: { t=findnumber(h); if(t==NULL) printf("没有要查询图书!!!"); if(t!=NULL) { printf("查询图书为:"); printf("\n");printf("\n**************************************************\n"); printf("\n编号\t\t书名\t\t作者\t\t出版社\t\t出版时间\t\t价格\t\t状态\n"); printf("\n"); printf("%s\t%s\t%s\t%s\t%s",t->number,t->bookname,t->author,t->publish,t->time); printf("\t\t%.2f",t->price); printf("\t\t%s",t->status); printf("\n"); } }break; case3: { t=findboookname(h); if(t==NULL) printf("没有要查询图书!!!"); if(t!=NULL) { printf("查询图书为:"); printf("\n");printf("\n**************************************************\n"); printf("\n编号\t\t书名\t\t作者\t\t出版社\t\t出版时间\t\t价格\t\t状态\n"); printf("\n"); printf("%s\t%s\t%s\t%s\t%s",t->number,t->bookname,t->author,t->publish,t->time); printf("\t\t%.2f",t->price); printf("\t\t%s",t->status); printf("\n"); } }break; case4: { t=findauthor(h); if(t==NULL) printf("没有要查询图书!!!"); if(t!=NULL) { printf("查询图书为:"); printf("\n");printf("\n**************************************************\n"); printf("\n编号\t\t书名\t\t作者\t\t出版社\t\t出版时间\t\t价格\t\t状态\n"); printf("\n"); printf("%s\t%s\t%s\t%s\t%s",t->number,t->bookname,t->author,t->publish,t->time); printf("\t\t%.2f",t->price); printf("\t\t%s",t->status); printf("\n"); } } break; case5: {

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论