实验室设备管理系统设计[1]

上传人:痛*** 文档编号:148065350 上传时间:2022-09-04 格式:DOC 页数:28 大小:168KB
收藏 版权申诉 举报 下载
实验室设备管理系统设计[1]_第1页
第1页 / 共28页
实验室设备管理系统设计[1]_第2页
第2页 / 共28页
实验室设备管理系统设计[1]_第3页
第3页 / 共28页
资源描述:

《实验室设备管理系统设计[1]》由会员分享,可在线阅读,更多相关《实验室设备管理系统设计[1](28页珍藏版)》请在装配图网上搜索。

1、1. 设计课题内容实验设备管理系统设计实验设备信息包括:设备编号,设备种类(如:微机、打印机、扫描仪等等),设备名称,设备价格,设备购入日期,是否报废,报废日期等。主要功能:1、能够完成对设备的录入和修改。2、对设备进行分类统计。3、设备的破损耗费和遗损处理。4、设备的查询。2. 应用程序的详细功能说明 该实验设备管理系统采用纯C语言编写,使用者能实验该管理系统方便、直观地对实验设备进行管理操作,如对实验设备信息的录入、实验设备信息的修改、查询需要的目标设备的信息并对其进行统计等等。 程序分两大系统,一是管理系统,二是查询系统。 在管理系统中 1. 建立链表储存设备信息::输入新的设备信息,若

2、当前设备管理系统中的设备还未录入时,建立新的链表来储存当前输入的设备信息,并返回链表的头指针指向第一个输入的设备的信息。 2. 插入新的设备信息:输入新的设备信息,且当前设备管理系统中的链表非空,则将新的设备信息插入链表,并返回链表头指针。 3. 修改设备信息:若对已有的设备的信息需要修改,则按设备编号进行查找,在成功找到该设备时,并选择需要修改的信息进行修改。 4. 删除设备信息:若已有设备的信息错误或该设备不可用即已经报废,则要对该条信息进行删除处理。5. 对设备进行遗损处理:当设备将要报废或已报废时则删除该设备的相关信息,并通知。 在查询系统中 1. 查找设备信息:当需要查看已有的设备信

3、息对设备进行进一步的管理和维护时,就可按设备编号、设备类型、设备名称、设备购入价格、设备购入时间、设备报废时间、设备是否可用对已有设备信息进行检索,同时也可选择查看所有设备信息。并且能在程序的根目录下的result.txt文件中查看信息。 3. 输入数据类型、格式和内容控制输入实验设备的信息:设备编号为整形;设备类型为10个字符;设备名称为20个字符;设备购入价格为浮点型,输出时保留一位小数;设备购入时间为整形设备报废时间为整形;设备是否可用为整形,记0为不可用,1为可用;4. 主要模块的算法描述4.1 简单算法描述1. 新的设备信息添加到链表2. 删除错误和无用的设备信息3. 查找所需相关类

4、型信息的设备信息4. 修改设备信息建立带头节点的链表head=tail=NULL输入设备信息num!=0指针申请内存单元p=(struct ShiyanEquip *) malloc(SIZE)p-next=NULLhead=NULLhead=ptail-next=ptail=p输入新设备信息返回头指针headNYYN4.2 流程图显示将新的设备信息插入链表指针申请内存单元pt2=(struct ShiyanEquip *) malloc (SIZE)链表为空head=NULLpt1=headhead=pt2head-next=NULLpt2-next=pt-nextpt-next=pt2输入

5、信息返回头指针headYN 删除节点操作的算法流程图输入要删除的设备的编号num链表是否为空head=NULL判断要删除的是否为头结点head-num=numpt1=headpt2=head-nextpt2!=NULLpt-num=numreturn NULLpt2=headhead=head-nextfree(pt2)pt1=pt2pt2=pt1-nextpt1-next=pt2-nextfree(pt2)返回头指针headYNYNYNYN5.结束语在课程设计中,我体会颇多,学到很多东西。我加强了对C的认识,复习了自己以前的知识,自己的逻辑思考能力也提高不少。从而对Microsoft Vis

6、ual C+ 6.0开发环境又有了更深入的认识!在这次课程设计中,我还总结了程序开发的一些比较重要的步骤,比如需求分析、总体设计、数据库设计(含概念设计、逻辑设计、物理设计)、程序模块设计(含功能需求、用户界面设计、程序代码设计与分析、运行结果)、系统使用说明等。这次课程设计激发了我对编程的兴趣和热情,让我从一个只懂理论变成了能做一些小型程序的人,使我对编程更加热爱了。在这次的课程设计中我考虑了很多的东西,产生了许多的问题,通过对资料的查找和筛选,我也找到了这些问题的解决办法,这使我有了很大的成就感,让我对编写程序有了更浓烈的兴趣和信心。相信在以后的设计中我会提交出更加优秀的作品!6.课程设计

7、源程序清单#include #include #include #include #include #define SIZE sizeof(struct ShiyanEquip)struct ShiyanEquipint num;char type10,name20;double price;int btime;int otime;int able;struct ShiyanEquip * next;/=函数声明struct ShiyanEquip * NewList();struct ShiyanEquip * InsertNode( struct ShiyanEquip *head, st

8、ruct ShiyanEquip *newin);void SearchNode( struct ShiyanEquip *head);void SearchNode_num( struct ShiyanEquip *head, int num);void SearchNode_type( struct ShiyanEquip *head, char type);void SearchNode_name( struct ShiyanEquip *head, char name);void SearchNode_price( struct ShiyanEquip *head, double pr

9、ice);void SearchNode_btime( struct ShiyanEquip *head, int btime);void SearchNode_otime( struct ShiyanEquip *head, int otime);void SearchNode_able( struct ShiyanEquip *head, int able);struct ShiyanEquip * Delete_num( struct ShiyanEquip *head, int num);void ChangeNode(struct ShiyanEquip *head,int num)

10、;void Dealwithpass( struct ShiyanEquip * head , int nowtime);struct ShiyanEquip * manage();void search(struct ShiyanEquip * head);static count=0;int main(void) struct ShiyanEquip * head=NULL;char chose;doprintf(*Wlecome to use my program *nn);printf(*Here is the Menu *n);printf(*No.1:管理系统 *n);printf

11、(*No.2:查询系统 *n);printf(*No.#:退出系统 *n);printf(*n);scanf(%s,&chose);switch(chose)case 1:head=manage();break;case 2:search(head);break;case #:system(cls);printf(*Thankyou for using my program *nn);exit(0);while (1);return 0;/=管理系统struct ShiyanEquip * manage()char chose2;int num,nowtime;char type10,name

12、20;double price;int btime;int otime;int able;struct ShiyanEquip * pcurr,* head;system(cls);dosystem(cls);printf(* 管理系统 *n);printf(*No.1:建立新实验器材管理清单 *n);printf(*No.2:插入新的实验器材 *n);printf(*No.3:删除目标器材信息 *n);printf(*No.4:修改目标器材信息 *n);printf(*No.5:遗损处理 *n);printf(*No.#:返回上级菜单 *n);printf(*n);scanf(%s,&cho

13、se2);switch(chose2)case 1:head=NewList();break;case 2:pcurr=(struct ShiyanEquip *)malloc(SIZE);printf(=输入实验器材的编号,类型,名称,价格,购入时间,报废时间,是否可用(0:报废;1:可用)=n); scanf(%d%s%s%lf%d%d%d,&num,type,name,&price,&btime,&otime,&able);pcurr-num=num;strcpy(pcurr-type,type);strcpy(pcurr-name,name);pcurr-price=price;pcu

14、rr-btime=btime;pcurr-otime=otime;pcurr-able=able;head=InsertNode(head,pcurr);break;case 3:printf(=请输入要删除的实验器材的编号=:);scanf(%d,&num);head=Delete_num(head,num);break;case 4:printf(=请输入要修改的实验器材的编号=:);scanf(%d,&num);ChangeNode(head,num);break;case 5:printf(=请输入现在的日期=);scanf(%d,nowtime);Dealwithpass(head,

15、nowtime);break;case #:system(cls);return head;while ( 1);return head;struct ShiyanEquip * NewList()/=新建链表int num;char type10,name20;double price;int btime;int otime;int able;struct ShiyanEquip * p,* head,* tail;head=tail=NULL;printf(录入实验器材的信息.n); printf(=输入实验器材的编号,类型,名称,价格,购入时间,报废时间,是否可用(0:报废;1:可用)=

16、n);scanf(%d%s%s%lf%d%d%d,&num,type,name,&price,&btime,&otime,&able);while ( num != 0)p=(struct ShiyanEquip *)malloc(SIZE);p-num=num;strcpy(p-type,type);strcpy(p-name,name);p-price=price;p-btime=btime;p-otime=otime;p-able=able;p-next = NULL;if (head = NULL)head = p;else tail-next = p;tail = p;printf(

17、=输入实验器材的编号,类型,名称,价格,购入时间,报废时间,是否可用(0:报废;1:可用)=n);scanf(%d%s%s%lf%d%d%d,&num,type,name,&price,&btime,&otime,&able);return head;struct ShiyanEquip * InsertNode (struct ShiyanEquip * head,struct ShiyanEquip *newin)/插入节点struct ShiyanEquip * pt1,* pt2;pt1=head;pt2=newin;if (head = NULL)head = pt2;head -n

18、ext = NULL;count+;elsept2 -next = pt1 -next;pt1 -next = pt2;count+;return head;struct ShiyanEquip * Delete_num( struct ShiyanEquip * head,int num)/=删除节点struct ShiyanEquip * pt1,* pt2;if ( head = NULL )return NULL;elseif ( head - num = num)pt2 = head;head = head - next;free(pt2);count-;return head;el

19、sept1 = head;pt2 = head - next;if (pt2 != NULL)if (pt2 - num = num)pt1 - next = pt2 - next;free(pt2);count-;elsept1 = pt2;pt2 = pt1 - next;return head;void ChangeNode(struct ShiyanEquip *head,int num)/=更改节点char type10,name20;double price;int btime;int otime;int able;int flag=0,chose4; struct ShiyanE

20、quip *pt; if (head = NULL) printf(=抱歉,没有任何信息!=n); return; for( pt = head; pt ; pt = pt - next) if(pt-num = num) printf(=选择要修改的信息=n); printf(=1.编号 =n); printf(=2.类型 =n); printf(=3.名称 =n); printf(=4.价格 =n); printf(=5.购入时间 =n); printf(=6.报废时间 =n); printf(=7.是否可用 =n);switch(chose4)case 1:printf(=请输入新的信息

21、=);scanf(%d,&num);pt-num=num;break;case 2:printf(=请输入新的信息=);scanf(%s,&type);strcpy(pt-type,type);break;case 3:printf(=请输入新的信息=);scanf(%s,&name);strcpy(pt-name,name);break;case 4:printf(=请输入新的信息=);scanf(%lf,&price);pt-price=price;break;case 5:printf(=请输入新的信息=);scanf(%d,&btime);pt-btime=btime;break;ca

22、se 6:printf(=请输入新的信息=);scanf(%d,&otime);pt-otime=otime;break;case 7:printf(=请输入新的信息=);scanf(%d,&able);pt-able=able;break; /=查询系统void search(struct ShiyanEquip * head)int num;char type10,name20;double price;int btime;int otime;int able;char chose3;system(cls);dosystem(cls);printf(* 查询系统 *n);printf(*N

23、o.1:按编号查找 *n);printf(*No.2:查找统一价格 *n);printf(*No.3:查找同一类型 *n);printf(*No.4:查找同一名称 *n);printf(*No.5:查找按购入日期 *n);printf(*No.6:查找按报废日期 *n);printf(*No.7:查找按是否可用 *n);printf(*No.8:显示全部器材信息 *n);printf(*No.#:返回上一级菜单 *n);printf(*n);scanf(%s,&chose3);switch(chose3)case 1:printf(=请输入要查找的编号=);scanf(%d,&num);Sea

24、rchNode_num(head,num);break;case 2:printf(=请输入想要查看的价格=);scanf(%lf,&price);SearchNode_price(head,price);break;case 3:printf(=请输入想要查找的类型=);scanf(%s,type);SearchNode_type(head,type);break;case 4:printf(=请输入想要查看的名称=);scanf(%s,name);SearchNode_name(head,name);break;case 5:printf(=请输入想要查看的购入时间=);scanf(%d,

25、&btime);SearchNode_btime(head,btime);break;case 6:printf(=请输入想要查看的报废时间=);scanf(%d,&otime);SearchNode_otime(head,otime);break;case 7:printf(=请输入要查看是否可用的器材(0:报废;1:可用)=);scanf(%d,&able);SearchNode_able(head,able);break;case 8:SearchNode(head);break;case #:system(cls);return;while ( 1);void SearchNode_n

26、um( struct ShiyanEquip *head, int num)/按编号查找 FILE *fp; if ( fp = fopen(result.txt,w) = NULL) printf(=文件打开错误!=n); exit(0); int flag=0; struct ShiyanEquip *pt; if (head = NULL) printf(=抱歉,没有任何信息!=n); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); return; for( pt = head; pt ; pt = pt - next) if(

27、pt-num = num) flag=1; printf(=n); printf(=编号%d n,pt-num); printf(=类型%s n,pt-type); printf(=名称%s n,pt-name); printf(=价格%.1lf n,pt-price); printf(=购入时间%d n,pt-btime); printf(=报废时间%d n,pt-otime); printf(=是否可用%d n,pt-able); printf(=n); fprintf(fp,=n); fprintf(fp,=编号%d n,pt-num); fprintf(fp,=类型%s n,pt-ty

28、pe); fprintf(fp,=名称%s n,pt-name); fprintf(fp,=价格%.1lf n,pt-price); fprintf(fp,=购入时间%d n,pt-btime); fprintf(fp,=报废时间%d n,pt-otime); fprintf(fp,=是否可用%d n,pt-able); fprintf(fp,=n); for( int i=10;i0;i-) Sleep(1000); printf(=可以在文件result.txt中查看更多=n); if ( flag = 0)printf(=抱歉没有找到您所要查找的器材=n);for( int i=5;i0

29、;i-)printf(%d秒后请重新操作n,i); Sleep(1000); if ( fclose(fp) ) printf(=文件关闭错误=n); exit(0); void SearchNode_type( struct ShiyanEquip *head, char type)/按类型查找 FILE *fp; if ( fp = fopen(result.txt,w) = NULL) printf(=文件打开错误!=n); exit(0); int countS=0; struct ShiyanEquip *pt; if (head = NULL) printf(=抱歉,没有任何信息!

30、=n); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); return; for( pt = head; pt ; pt = pt - next) if (strcmp(pt-type,type) = 0) countS+; printf(=n); printf(=编号%d n,pt-num); printf(=类型%s n,pt-type); printf(=名称%s n,pt-name); printf(=价格%.1lf n,pt-price); printf(=购入时间%d n,pt-btime); printf(=报废时间%d

31、 n,pt-otime); printf(=是否可用%d n,pt-able); printf(=n); fprintf(fp,=n); fprintf(fp,=编号%d n,pt-num); fprintf(fp,=类型%s n,pt-type); fprintf(fp,=名称%s n,pt-name); fprintf(fp,=价格%.1lf n,pt-price); fprintf(fp,=购入时间%d n,pt-btime); fprintf(fp,=报废时间%d n,pt-otime); fprintf(fp,=是否可用%d n,pt-able); fprintf(fp,=n); f

32、or( int i=10;i0;i-) Sleep(1000); if ( countS = 0) printf(=抱歉没有找到您所要查找的器材=n);for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); else printf(=共查找到%d条信息=n,countS); printf(=可以在文件result.txt中查看更多=n); fprintf(fp,=共查找到%d条信息=n,countS); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); if ( fclose(fp)

33、) printf(=文件关闭错误=n); exit(0); void SearchNode_name( struct ShiyanEquip *head, char name)/按名称查找FILE *fp; if ( fp = fopen(result.txt,w) = NULL) printf(=文件打开错误!=n); exit(0); int countS=0; struct ShiyanEquip *pt; if (head = NULL) printf(=抱歉,没有任何信息!=n); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000

34、); return; for( pt = head; pt ; pt = pt - next) if (strcmp(pt - name,name) = 0) countS+; printf(=n); printf(=编号%d n,pt-num); printf(=类型%s n,pt-type); printf(=名称%s n,pt-name); printf(=价格%.1lf n,pt-price); printf(=购入时间%d n,pt-btime); printf(=报废时间%d n,pt-otime); printf(=是否可用%d n,pt-able); printf(=n); f

35、printf(fp,=n); fprintf(fp,=编号%d n,pt-num); fprintf(fp,=类型%s n,pt-type); fprintf(fp,=名称%s n,pt-name); fprintf(fp,=价格%.1lf n,pt-price); fprintf(fp,=购入时间%d n,pt-btime); fprintf(fp,=报废时间%d n,pt-otime); fprintf(fp,=是否可用%d n,pt-able); fprintf(fp,=n); for( int i=10;i0;i-) Sleep(1000); if ( countS = 0) prin

36、tf(=抱歉没有找到您所要查找的器材=n);for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); else printf(=共查找到%d条信息=n,countS); printf(=可以在文件result.txt中查看更多=n); fprintf(fp,=共查找到%d条信息=n,countS); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); if ( fclose(fp) ) printf(=文件关闭错误=n); exit(0); void SearchNode_price( s

37、truct ShiyanEquip *head, double price)/按价格查找FILE *fp; if ( fp = fopen(result.txt,w) = NULL) printf(=文件打开错误!=n); exit(0); int countS=0; struct ShiyanEquip *pt; if (head = NULL) printf(=抱歉,没有任何信息!=n); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); return; for( pt = head; pt ; pt = pt - next) if

38、(pt - price = price) countS+; printf(=n); printf(=编号%d n,pt-num); printf(=类型%s n,pt-type); printf(=名称%s n,pt-name); printf(=价格%.1lf n,pt-price); printf(=购入时间%d n,pt-btime); printf(=报废时间%d n,pt-otime); printf(=是否可用%d n,pt-able); printf(=n); fprintf(fp,=n); fprintf(fp,=编号%d n,pt-num); fprintf(fp,=类型%s

39、 n,pt-type); fprintf(fp,=名称%s n,pt-name); fprintf(fp,=价格%.1lf n,pt-price); fprintf(fp,=购入时间%d n,pt-btime); fprintf(fp,=报废时间%d n,pt-otime); fprintf(fp,=是否可用%d n,pt-able); fprintf(fp,=n); for( int i=10;i0;i-) Sleep(1000); if ( countS = 0) printf(=抱歉没有找到您所要查找的器材=n);for( int i=5;i0;i-)printf(%d秒后请重新操作n,

40、i); Sleep(1000); else printf(=共查找到%d条信息=n,countS); printf(=可以在文件result.txt中查看更多=n); fprintf(fp,=共查找到%d条信息=n,countS); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); if ( fclose(fp) ) printf(=文件关闭错误=n); exit(0); void SearchNode_btime( struct ShiyanEquip *head, int btime)/按购入时间查找 FILE *fp; if (

41、fp = fopen(result.txt,w) = NULL) printf(=文件打开错误!=n); exit(0); int countS=0; struct ShiyanEquip *pt; if (head = NULL) printf(=抱歉,没有任何信息!=n); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); return; for( pt = head; pt ; pt = pt - next) if(pt - btime = btime) countS+; printf(=n); printf(=编号%d n,pt

42、-num); printf(=类型%s n,pt-type); printf(=名称%s n,pt-name); printf(=价格%.1lf n,pt-price); printf(=购入时间%d n,pt-btime); printf(=报废时间%d n,pt-otime); printf(=是否可用%d n,pt-able); printf(=n); fprintf(fp,=n); fprintf(fp,=编号%d n,pt-num); fprintf(fp,=类型%s n,pt-type); fprintf(fp,=名称%s n,pt-name); fprintf(fp,=价格%.1

43、lf n,pt-price); fprintf(fp,=购入时间%d n,pt-btime); fprintf(fp,=报废时间%d n,pt-otime); fprintf(fp,=是否可用%d n,pt-able); fprintf(fp,=n); for( int i=10;i0;i-) Sleep(1000); if ( countS = 0) printf(=抱歉没有找到您所要查找的器材=n);for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); else printf(=共查找到%d条信息=n,countS); printf(=可以在文件result.txt中查看更多=n); fprintf(fp,=共查找到%d条信息=n,countS); for( int i=5;i0;i-)printf(%d秒后请重新操作n,i); Sleep(1000); if ( fclose(fp) ) printf(=文件关闭错误=n); exit(0); void SearchNode_able( struct

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

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!