实验设备管理系统-课程设计.doc_第1页
实验设备管理系统-课程设计.doc_第2页
实验设备管理系统-课程设计.doc_第3页
实验设备管理系统-课程设计.doc_第4页
实验设备管理系统-课程设计.doc_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

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

文档简介

实验设备管理系统-课程设计实验设备管理系统|c语言程序代码编程小程序设计|c语言课程设计报告课程案例 #include #include struct instrumentchar p_num12;char name12;char spec12;int amount;int price;int s_price;struct instrument *next;struct instrument *head;struct in_instrumentchar num12;char p_num12;char name12;int amount;int price;int t_price;struct in_instrument *next;struct in_instrument *ihead;struct out_instrumentchar num12;char p_num12;char name12;int amount;int price;int t_price;struct out_instrument *next;struct out_instrument *ohead;struct quit_instrumentchar num12;char p_num12;char name12;int amount;int price;int t_price;struct quit_instrument *next;struct quit_instrument *qhead;int init()head=ihead=ohead=qhead=NULL;printf(0: Quitn);printf(1: Enter the information of in instrumentn);printf(2: Enter the information of out instrumentn);printf(3: Enter the information of quit instrumentn);printf(4: Total the information of instrumentn);int menu()printf(1:insert datan);printf(2:delete datan);printf(3:modify datan);printf(4:select datan);printf(Other to quitn);int menu2()printf(0: Quitn);printf(1: Enter the information of in instrumentn);printf(2: Enter the information of out instrumentn);printf(3: Enter the information of quit instrumentn);printf(4: Total the information of instrumentn);int insert_instrument()struct instrument * p1,* p;p1=(struct instrument *)malloc(sizeof(struct instrument);p=head;if (p=NULL)/*开始没有数据*/printf(Enter the data of instrumentn);printf(Include the spbh,name,style,num,price,sale_price of instrumentn);scanf(%s%s%s%d%d%d,&p1-p_num,&p1-name,&p1-spec,&p1-amount,&p1-price,&p1-s_price);head=p1;head-next=NULL;return 0;while(p-next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/p=p-next;p-next=p1;printf(Enter the datan);scanf(%s%s%s%d%d%d,&p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price);p1-next=NULL;int in_insert()struct in_instrument * p1,* p;p1=(struct in_instrument *)malloc(sizeof(struct in_instrument);p=ihead;if (p=NULL)/*开始没有数据*/printf(Enter the data of in instrumentn);printf(Include the rkbh,spbh,name,number,price,total_pricen);scanf(%s%s%s%d%d%d,&p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price);ihead=p1;ihead-next=NULL;return 0;while(p-next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/p=p-next;p-next=p1;printf(Enter the datan);scanf(%s%s%s%d%d%d,&p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price);p1-next=NULL;int in_modify()char m_num12;struct in_instrument * p;p=ihead;printf(Enter the modify numn);scanf(%s,&m_num);if (p=NULL)/*开始没有数据*/printf(Sorry! No data can be foundn);return 0;while(p!=NULL)if (strcmp(p-num,m_num)=0)printf(Enter the new data without numn);scanf(%s%s%d%d%d,&p-p_num,&p-name,&p-amount,&p-price,&p-t_price);printf(One data had modifiedn);return 0;p=p-next;printf(Sorry! No num has foundn);int in_select()char s_num12;struct in_instrument * p;p=ihead;printf(Enter the select numn);scanf(%s,&s_num);while(p!=NULL)if (strcmp(p-num,s_num)=0)printf(The data you want is:n);printf( %s %s %s %d %d %dn,p-num,p-p_num,p-name,p-amount,p-price,p-t_price);return 0;p=p-next;printf(Sorry! No num has foundn);int in_delete()char d_num12;struct in_instrument * p1,* p;p=ihead;printf(Enter the delete numn);scanf(%s,&d_num);if (p=NULL)/*开始没有数据*/printf(No data can be foundn);return 0;if (strcmp(p-num,d_num)=0 & p-next=NULL)/*链表只有一个数据,且是要删除的*/ihead=NULL;printf(One data has been deletedn);return 0;if (strcmp(p-num,d_num)=0 & p-next!=NULL)/*要删除的数据在链表的头上*/ihead=ihead-next;printf(One data has been deletedn);return 0;while(p-next!=NULL)p1=p-next;if (strcmp(p1-num,d_num)=0)p-next=p1-next;printf(One data has been deletedn);return 0;p=p-next;printf(Sorry! No num has foundn);int out_insert()struct out_instrument * p1,* p;p1=(struct out_instrument *)malloc(sizeof(struct out_instrument);p=ohead;if (p=NULL)/*开始没有数据*/printf(Enter the data of out instrumentn);printf(Include the ckbh,spbh,name,number,price,total_pricen);scanf(%s%s%s%d%d%d,&p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price);ohead=p1;ohead-next=NULL;return 0;while(p-next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/p=p-next;p-next=p1;printf(Enter the datan);scanf(%s%s%s%d%d%d,&p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price);p1-next=NULL;int out_modify()char m_num12;struct out_instrument * p;p=ohead;printf(Enter the modify numn);scanf(%s,&m_num);if (p=NULL)/*开始没有数据*/printf(Sorry! No data can be foundn);return 0;while(p!=NULL)if (strcmp(p-num,m_num)=0)printf(Enter the new data without numn);scanf(%s%s%d%d%d,&p-p_num,&p-name,&p-amount,&p-price,&p-t_price);printf(One data had modifiedn);return 0;p=p-next;printf(Sorry! No num has foundn);int out_select()char s_num12;struct out_instrument * p;p=ohead;printf(Enter the select numn);scanf(%s,&s_num);while(p!=NULL)if (strcmp(s_num,p-num)=0)printf(The data you want is:n);printf( %s %s %s %d %d %dn,p-num,p-p_num,p-name,p-amount,p-price,p-t_price);return 0;p=p-next;printf(Sorry! No num has foundn);int out_delete()char d_num12;struct out_instrument * p1,* p;p=ohead;printf(Enter the delete numn);scanf(%s,&d_num);if (p=NULL)/*开始没有数据*/printf(No data can be foundn);return 0;if (strcmp(p-num,d_num)=0 & p-next=NULL)/*链表只有一个数据,且是要删除的*/ohead=NULL;printf(One data has been deletedn);return 0;if (strcmp(p-num,d_num)=0 & p-next!=NULL)/*要删除的数据在链表的头上*/ohead=ohead-next;printf(One data has been deletedn);return 0;while(p-next!=NULL)p1=p-next;if (strcmp(p1-num,d_num)=0)p-next=p1-next;printf(One data has been deletedn);return 0;p=p-next;printf(Sorry! No num has foundn);int quit_insert()struct quit_instrument * p1,* p;p1=(struct quit_instrument *)malloc(sizeof(struct quit_instrument);p=qhead;if (p=NULL)/*开始没有数据*/printf(Enter the data of quit instrumentn);printf(Include the thbh,spbh,name,number,price,total_pricen);scanf(%s%s%s%d%d%d,&p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price);qhead=p1;qhead-next=NULL;return 0;while(p-next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/p=p-next;p-next=p1;printf(Enter the datan);scanf(%s%s%s%d%d%d,&p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price);p1-next=NULL;int quit_modify()char m_num12;struct quit_instrument * p;p=qhead;printf(Enter the modify numn);scanf(%s,&m_num);if (p=NULL)/*开始没有数据*/printf(Sorry! No data can be foundn);return 0;while(p!=NULL)if (strcmp(p-num,m_num)=0)printf(Enter the new data without numn);scanf(%s%s%d%d%d,&p-p_num,&p-name,&p-amount,&p-price,&p-t_price);printf(One data had modifiedn);return 0;p=p-next;printf(Sorry! No num has foundn);int quit_select()char s_num12;struct quit_instrument * p;p=qhead;printf(Enter the select numn);scanf(%s,&s_num);while(p!=NULL)if (strcmp(s_num,p-num)=0)printf(The data you want is:n);printf( %s %s %s %d %d %dn,p-num,p-p_num,p-name,p-amount,p-price,p-t_price);return 0;p=p-next;printf(Sorry! No num has foundn);int quit_delete()char d_num12;struct quit_instrument * p1,* p;p=qhead;printf(Enter the delete numn);scanf(%s,&d_num);if (p=NULL)/*开始没有数据*/printf(No data can be foundn);return 0;if (strcmp(p-num,d_num)=0 & p-next=NULL)/*链表只有一个数据,且是要删除的*/qhead=NULL;printf(One data has been deletedn);return 0;if (strcmp(p-num,d_num)=0 & p-next!=NULL)/*要删除的数据在链表的头上*/qhead=qhead-next;printf(One data has been deletedn);return 0;while(p-next!=NULL)p1=p-next;if (strcmp(p1-num,d_num)=0)p-next=p1-next;printf(One data has been deletedn);return 0;p=p-next;printf(Sorry! No num has foundn);int total()int in_num=0,in_price=0;int out_num=0,out_price=0;int num=0,price=0;struct in_instrument *ip;struct out_instrument *op;struct instrument *p;ip=ihead;while(ip!=NULL)in_num+=ip-amount;in_price+=ip-t_price;ip=ip-next;op=ohead;while(op!=NULL)out_num+=op-amount;out_price+=op-t_price;op=op-next;p=head;while(p!=NULL)num+=p-amount;price+=p-s_price;p=p-next;printf(The in instruments total number and total price is:n);printf(%d %dn,in_num,in_price);printf(The out instruments total number and total price is:n);printf(%d %dn,out_num,out_price);printf(The instruments total number and total price is:n);printf(%d %dn,num,price);int in_case()int choice;printf(The information of in instrument:n);while(1)printf(Enter the choicen);scanf(%d,&choice);switch(choice)case 1: in_i

温馨提示

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

评论

0/150

提交评论