西安郵電大学软件课程设计报告题目:实验室设备管理系统院系名称:电子工程学院专业名称:电子信息工程班级:1204班内序号:5学生姓名:诺贝尔杨时间:2013年3月18日至2013年3月29日1.课程设计目的实验设备信息包括:设备编号,设备种类(如:微机、打印机、扫描仪等等),设备名称,设备价格,设备购入日期,是否报废,报废日期等。
主要功能:1.录入设备信息2.修改设备信息3.查询设备信息(1)按设备编号查询(2)按设备名称查询4.对设备按种类进行分类统计5.报废设备登记。
6.报废设备统计。
2.设计思路需求分析实验室设备信息用文件存储,提供文件的输入输出操作;要能够完成设备的录入和修改,需要提供设备添加和修改操作;实现对设备进行分类统计,需要提供排序操作;实现对设备查询需要提供查找操作,设备的查询可根据设备编号设备种类设备购入日期正常设备(未报废的)等多种方式查询;另外还要根据键盘式选择菜单以实现功能选择。
整个系统可设计为实验设备信息输入模块实验设备信息修改模块实验设备分类统计模块实验设备查询模块和实验设备报废信息模块。
建立实验设备信息结构体,结构体成员包括设备编号设备种类设备名称设备价格设备购入日期是否报废报废日期。
3.功能模块图5.程序代码#include""#include""#define null 0int t=0;int mmcsz=0;int mima;int menu();d);if(strcmp(sb[t].id,"0")==0) main();printf("\n请输入设备名称:");scanf("%s",sb[t].name);printf("\n请输入设备种类:");scanf("%s",sb[t].kind);printf("\n请输入报废日期:");scanf("%s",sb[t].over);printf("\n请输入设备是否报废,1、没报废,0、报废:");scanf("%d",&sb[t].yesno);printf("\n请输入设备购买时间:");scanf("%s",sb[t].time);printf("\n请输入设备价格:");scanf("%s",sb[t].price);printf("提示:已经完成一条记录的添加。
\n");t++;}}void xg()d,find)==0) d);scanf("%s",sb[t].id);printf("请输入新设备名称(原来是 %s ):",sb[t].name);scanf("%s",sb[t].name);printf("请输入新设备设备种类名称(原来是 %s ):",sb[t].kind);scanf("%s",sb[t].kind);printf("请输入新设备报废日期名称(原来是 %s ):",sb[t].over);scanf("%s",sb[t].over);printf("请输入新设备是否报废,1、没报废,0、报废(原来是 %d):",sb[t].yesno);scanf("%d",&sb[t].yesno);printf("请输入新设备购买时间(原来是 %s ):",sb[t].time);scanf("%s",sb[t].time);printf("请输入新设备价格(原来是 %s ):",sb[t].price);scanf("%s",sb[t].price);printf("\n提示:该项记录资料已经成功修改!\n");printf("退回主菜单请输入0\n");printf("继续操作请输入1\n");scanf("%d",&x);switch(x){case 0:choose();break;case 1:xg();break;default:printf("输入无效,自动返回主菜单\n");choose();break;}}}}void cx()d,find)==0&&sb[t].yesno==1) d,sb[t].name,sb[t].kind,sb[t].over,sb[t].yesno,sb[t].time,sb[t].price);t++;}elset++;}while (t<100);printf("键入数字1返回主菜单\n");printf("键入数字任意键返回上层菜单\n");scanf("%d",&choice);if (choice==1)choose();else cx();}void cx_mc()ame,ming)==0&&sb[t].yesno==1) d,sb[t].name,sb[t].kind,sb[t].over,sb[t].yesno,sb[t].time,sb[t].price);t++;}elset++;}while (t<100);printf("键入数字1返回主菜单\n");printf("键入数字任意键返回上层菜单\n");scanf("%d",&choice);if (choice==1)choose();else cx();}void tj()ind,tong)==0&&sb[t].yesno==1) d,sb[t].name,sb[t].kind,sb[t].over,sb[t].yesno,sb[t].time,sb[t].price);t++;}elset++;}while (t<100);printf("键入数字1返回主菜单\n");printf("键入数字任意键返回上层菜单\n");scanf("%d",&choice);if (choice==1)choose() ;}void bf() d,find)==0) esno);scanf("%d",&sb[t].yesno);printf("\n>>>>>>>>>>提示:该项记录资料已经成功登记!\n");scanf("%d",&x);switch(x){case 0:choose();break;case 1:bf();break;default:printf("输入无效,自动返回主菜单\n");choose();break;}}}}void bf_tj()ind,find)==0&&sb[t].yesno==0) d,sb[t].name,sb[t].kind,sb[t].over,sb[t].yesno,sb[t].time,sb[t].price);t++;}elset++;}while (t<3);printf("键入数字1返回主菜单\n");printf("键入数字任意键返回上层菜单\n");scanf("%d",&choice);if (choice==1)choose();}int menu(int choice){printf("\n\n\n");printf("\t\t\t--------------------------------\n");printf("\t\t\t+ 实验设备管理系统 |\n");printf("\t\t\t--------------------------------\n");printf("\t\t\t+ [1]----录入设备信息 |\n");printf("\t\t\t+ [2]----修改设备信息 |\n");printf("\t\t\t+ [3]----查询设备信息 |\n");printf("\t\t\t+ [4]----统计设备信息 |\n");printf("\t\t\t+ [5]----报废设备信息 |\n");printf("\t\t\t+ [0]----*-EXIT-* |\n");printf("\t\t\t+*·*·*·*·*·*·*·*·*·*·|\n");printf("\t\t\t--------------------------------\n");printf("请输入你要操作的序号:");scanf("%d", &choice);return choice;}void choose(){int choice;choice=1;choice=menu(choice);do{switch (choice){case 0: printf("\n提示:你已经退出系统\n\t\t 再见!\n"); break; case 1: lr(); break;case 2: xg(); break;case 3: cx(); break;case 4: tj(); break;case 5: bf(); break;default: printf("提示:输入错误!\n"); break;}}while(choice!=0);}main(){char s[20];int i;if(mmcsz==0){printf("请输入登录密码:");序运行结果7.编程中遇到的困难和解决方法在编程的过程中,很容易出现很多个个问题,就时少大括号“}”、等号“==”。