版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、*实践教学实践教学* 兰州理工大学兰州理工大学计算机与通信学院2010 年春季学期 算法与数据结构算法与数据结构 课程设计课程设计题 目: 仓库货品管理 专业班级:08 级计算机科学与技术 5 班姓 名: 马菁 学 号: 08240507 指导教师: 李 睿 成 绩:_ 目目 录录摘摘 要要.3前前 言言.4正正 文文.51.采用类C语言定义相关的数据类型.5 2.各模块的伪码算法.53.函数的调用关系图.124.调试分析.135.测试结果.13 6.源程序(带注释).16总总 结结.28参考文献参考文献.30致致 谢谢.31附附 件件部分源程序代码部分源程序代码.32摘摘 要要本文介绍了小型
2、仓库管理系统的设计与实现。通过对仓库基本功能的分析,该程序实现了对小型仓库管理的基本操作。设计要求主要是货品入库、出库、查找及显示库存量等最基本功能操作。在课程设计过程中,对问题的所采用的数据结构和算法分析,及程序设计语言采用 VC,程序运行的平台是WindowsXP(visual C+6.0),逐步对基本要求进行分布实现,在设计中采用单链表和文件对录入的基本数据进行存储,最终对产品进行的基本操作如产品入库、出库及查找都基本以实现。该小型仓库管理系统的界面可视化程度较高,操作者和使用者使用较为便。 关键字: 仓库货品管理 ;单链表 ;数据结构和算法;前前 言言 我们对教学计划有一个系统的认识,
3、大学的每个专业都要制定教学计划。假设任何专业都有固定的学习年限,每学年含两学期,每学期的时间长度和学分上限值均相等。每个专业开设的课程都是确定的,而且课程在开设时间的安排必须满足先修关系。每门课程有哪些先修课程是确定的,可以有任意多门,也可以没有。每门课恰好占一个学期。试在这样的前提下设计一个教学计划编制程序。通过该题目的设计过程,可以加深理解数据的逻辑结构、存储结构,掌握线性表上基本运算的实现,进一步理解和熟练掌握课本中所学的各种数据结构,学会如何把学到的知识用于解决实际问题,培养学生的动手能力。通过本次课程设计的制作,能让我们对数据结构以及程序设计有更深的体会,流程图的建立能提高我们系统分
4、析问题的能力,从而灵活的驾驭整个程序的运行,通过对图的顶点的存储,让我们加深对邻接表的应用,更重要的是拓扑排序的复习,大一时,我们曾在离散数学中学习了拓扑排序,此次课程设计不仅能让我们学习数据结构的知识,同时也能让我们系统复习一下图论的知识。 正文正文 1. 采用类采用类 c 语言定义相关的数据类型语言定义相关的数据类型menu_init ()+新建仓库 newstore()+打开仓库 openstore()+添加货物 addproduct() +修改货物 editproduct() +删除货物 delproduct() +库存管理 menu_store()-货物出库 instore()-货物
5、进库 outstore() +货物查询 menu_check() +按编号查询 bynumber() +按名称查询 byname() +储存数据 savedata()+所有货物 listall() +退出系统 exit()1.2 数据设计商品结构体设计:struct Productint num; char name20;float rice;int amount;struct *next; 2 各模块的伪码算法各模块的伪码算法:2.1 菜单类:menu_init();说明:初始化界面menu_store();说明:库存管理界面menu_check(); 说明:货物查询界面menu exit(
6、);说明:退出界面2.2 货物管理类货物管理类:addproduct( struct Product *head );说明: struct Product *head 为要添加节点的链表功能:添加货物流程图:editproduct( struct Product *head );说明: struct Product *head 为要修改节点的链表功能:修改货物流程图:delproduct( struct Product *head );说明: struct Product *head 为要修改节点的链表功能:删除货物流程图:instore( struct Product *head );说明:
7、 struct Product *head 为要修改节点的链表功能:修改货物outstore( struct Product *head );说明: struct Product *head 为要修改节点的链表功能:修改货物outinstore( struct Product *head, int ouin );说明: struct Product *head 为要修改节点的链表功能:出库进库综合操作类2.3 货物查询类货物查询类:bynumber( struct Product *head, int num );说明: struct Product *head 为要修改节点的链表, num
8、为商品编号功能:按编号查询商品byname( struct Product *head, char *name );说明: struct Product *head 为要修改节点的链表, name 为商品名称功能:按名称查询商品listall( struct Product *head );说明: struct Product *head 为要显示链表功能:显示所有商品流程图:2.4 仓库管理类仓库管理类:openstore( );说明: 打开仓库数据文件到链表功能:打开仓库文件NS 流程图:savedata( );说明: 写仓库链表数据到文件功能:储存货品数据2.5 辅助类辅助类:cls(
9、);说明: 换行功能:换行struct Product *h = NULL;输入文件名 filename01 1. .2 2 1 1. .4 4 1 1. .6 6 1 1. .7 7 1 1. .8 8 1 1. .9 9 1 1. .1 10 0 2 2. .1 1 2 2. .4 4 3 3. .1 1 3 3. .2 2 3 3. .5 5 4 4. .1 1 4 4. .2 2 4 4. .3 3 5 5. .1 1 5 5. .2 2 5 5. .3 3 5 5. .4 4 6 6. .2 2 6 6. .3 3 return h;filenamefp = fopen (filen
10、ame,”rb”)return h;FTwhile( !feof(fp) )q-next; return h;fread( pd, Length, 1, fp )Fbreak;q = pd;pd = pd -next;3.函数的调用关系图:函数的调用关系图:四、五、调试分析与结果四、五、调试分析与结果:1 程序运行时初始界面程序运行时初始界面2 新建仓库新建仓库用键盘输入 1,程序调用新建仓库功能函数,要求用户输入货物编号,货物名称,货物价格等。3 打开仓库文件打开仓库文件用键盘输入 2,程序调用打开仓库文件功能函数,要求用户输入仓库数据文件名,数据文件存在,显示打开成功。4 添加货物用键盘输
11、入 3,程序调用添加货物功能函数,要求用户输入货物编号,货物名称,货物价格等。5 修改货物修改货物用键盘输入 4,程序调用修改货物功能函数,要求用户输入货物编号,货物存在,显示货物详细信息,按任意键后,要求用户输入新货物名称,货物价格等。6 删除货物删除货物用键盘输入 5,程序调用删除货物功能函数,要求用户输入货物编号,货物存在,显示货物详细信息,按任意键后,删除货物。7 库存管理库存管理:用键盘输入 6,程序调用库存管理功能函数,显示库存管理子页面,选择 2,货物出库,要求用户输入货物编号,货物存在,显示货物详细信息,要求用户输入进库数量。8 货物查询货物查询用键盘输入 7,程序调用货物查询
12、功能函数,显示货物查询子页面,选择 1,按编号查询,要求用户输入货物编号,货物存在,显示货物详细信息。货若物不存在,显示“没有该编号货物” 。9 储存数据储存数据用键盘输入 8,程序调用储存数据功能函数,要求用户输入文件名,将数据储存在指定文件中。10 所有货物所有货物用键盘输入 9,程序调用所有货物功能函数,显示仓库内所有货物。11 退出系统退出系统用键盘输入 0,程序调用货退出系统功能函数,显示提示保存信息。6.源程序源程序( (带注释带注释):):#include #include /*#include */#include #include #define Length sizeof(
13、 struct Product )/*定义货品结构体*/struct Product int num; char name20; float rice; int amount; struct Product *next;void cls( void ) int i; for( i=0; inext = (struct Product *)malloc( Length ); if( pd-next = NULL ) printf(内存溢出n); / getch(); return(h); q = pd; pd = pd-next; q-next = NULL; fclose( fp ); pri
14、ntf(成功打开仓库数据文件n); / getch(); return(h);int savedata( struct Product *head ) char filename255; struct Product *pd; FILE *fp; pd = head; printf(请输入要保存的仓库数据文件名(如:store,0 取消):n); scanf(%s, &filename); if( filename0 = 0 ) return 1; if( (fp=fopen(filename, wb) ) = NULL ) printf(储存文件出错n); / getch(); re
15、turn 1; printf(正在储存数据.n); while( pd!=NULL ) fwrite( pd, Length, 1, fp); pd = pd-next; fclose( fp ); printf(仓库数据保存成功n); / getch(); return 0;/*/创建链表,新建一个仓库,并输入数据/返回链表*/struct Product *newstore() struct Product *h = NULL, *pd; for(;) pd = (struct Product *)malloc( Length ); if (!pd) printf(内存溢出!n); / g
16、etch(); return NULL; printf(请输入货品编号(0 退出):n); scanf(%d, &pd-num); if( pd-num = 0 ) break; printf(请输入货品名称:n); scanf(%s, &pd-name); printf(请输入货品价格:n); scanf(%f, &pd-rice); printf(请输入货品库存量:n); scanf(%d, &pd-amount ); printf(n); pd-next = h; h = pd; return(h);/*/添加货品,向链表末尾添加货品/参数:*head 链
17、表指针/返回添加货品的链表*/struct Product *addproduct( struct Product *head ) struct Product *h, *pd; if( !head ) printf(请先创建或打开仓库n);return head; else h = head; for(;) pd = (struct Product *)malloc( Length ); if (!pd) printf(内存溢出!n); / getch(); break; printf(请输入货品编号(0 退出):n); scanf(%d, &pd-num); if( pd-num
18、= 0 ) break; printf(请输入货品名称:n); scanf(%s, &pd-name); printf(请输入货品价格:n); scanf(%f, &pd-rice); printf(请输入货品库存量:n); scanf(%d, &pd-amount ); printf(n); while( h-next!=NULL ) h = h-next; h-next = pd; pd-next = NULL; return(h);/*/按编号查找货品/参数:*head 链表指针,*num 货品编号/返回:链表结点*/struct Product *bynumbe
19、r( struct Product *head, int num ) float total; int n = num; struct Product *pd; pd = head; while( pd!=NULL&pd-num!=n) pd = pd-next; if( pd = NULL) printf(没有该编号货品。n); / getch(); else printf(t*按编号查询货品*n); printf(t| 编号 | 名称 | 价格 | 库存 | 价值量 |n); printf(t|-|-|-|-|-|n); printf(t|%6d|%-13s|%9.3f|%8d|,
20、 pd-num, pd-name, pd-rice, pd-amount); total = pd-rice * pd-amount; printf(%9.3f|n, total); printf(t*n); / getch(); return(pd);/*/按名称查找货品/参数:*head 链表指针,*name 货品名称/返回:链表结点*/struct Product *byname( struct Product *head, char name20 ) float total; struct Product *pd; pd = head; while( pd!=NULL&strc
21、mp(pd-name, name)!=0) pd = pd-next; if( pd = NULL) printf(没有该名称货品。n); / getch(); else printf(t*按名称查询货品*n); printf(t| 编号 | 名称 | 价格 | 库存 | 价值量 |n); printf(t|-|-|-|-|-|n); printf(t|%6d|%-18s|%9.3f|%8d|, pd-num, pd-name, pd-rice, pd-amount); total = pd-rice * pd-amount; printf(%9.3f|n, total); printf(t*
22、n); / getch(); return(pd); void *checkbynumber( struct Product *head ) struct Product *h = head; int num; printf(请输入查询编号(0 退出):n); scanf(%d, &num); return bynumber( h, num); void *checkbyname( struct Product *head ) struct Product *h = head; char name20; printf(请输入货品名称(0 退出):n); scanf(%s, &n
23、ame); return byname( h, name);/*/修改货品/参数:*head 链表指针/返回:链表结点*/struct Product *editproduct( struct Product *head ) int num; struct Product *h, *pd; h = head; for(;) pd = (struct Product *)malloc( Length ); if (!pd) printf(内存溢出!n); / getch(); break; printf(请输入要修改的货品编号:(0 退出)n); scanf(%d, &num); if(
24、 num = 0 ) break; pd = bynumber( h, num); if( pd = NULL) break; printf(请输入货品新名称:n); scanf(%s, &pd-name); printf(请输入货品新价格:n); scanf(%f, &pd-rice); printf(n); return(h);struct Product *delproduct( struct Product *head ) int num; char confirm; struct Product *h, *q, *pd; pd = q = h = head; for(
25、;) printf(请输入要删除的货品编号:(0 退出)n); scanf(%d, &num); if( num = 0 ) break; while( pd!=NULL&pd-num!=num) q = pd; pd = pd-next; if( pd = NULL) printf(没有该编号货品。n); else bynumber( h, num); / getch(); if(pd=h) /*如果 p=h,说明被删结点是头结点*/ h=pd-next; /*修改头指针指向下一条记录*/ else q-next=pd-next; printf(删除成功n); return(
26、h);/*/货品进库出库/参数:*head 链表指针, *outin 为进库出库类型,0 表示出库/返回:链表结点*/struct Product *outinstore( struct Product *head, int outin ) int num, outnum; struct Product *h, *pd; h = head; for(;) pd = (struct Product *)malloc( Length ); if (!pd) printf(内存溢出!n);/ getch(); break; printf(请输入要修改的货品编号:(0 退出)n); scanf(%d,
27、 &num); if( num = 0 ) break; pd = bynumber( h, num); if(!pd) break; if( outin = 0) printf(请输入货品出库数量:n); scanf(%d, &outnum); pd-amount = pd-amount - outnum; else printf(请输入货品进库数量:n); scanf(%d, &outnum); pd-amount = pd-amount + outnum; printf(n); return(h);/*/货品出库*/struct Product *outstore
28、(struct Product *head) struct Product *h = head; return outinstore(h, 0);/*/货品进库 */struct Product *instore(struct Product *head) struct Product *h = head; return outinstore(h, 1); void listall( struct Product *head) float total=0, all=0; struct Product *pd; pd = head; if( pd = NULL ) cls(); printf(错
29、误:当前未打开任何仓库n); / getch(); return; cls(); printf(t*仓库内所有货品*n); printf(tt| 编号 | 名称 | 价格 | 库存 | 价值量 |n); printf(tt|-|-|-|-|-|n); do printf(tt|%6d|%-13s|%9.3f|%8d|, pd-num, pd-name, pd-rice, pd-amount); total = pd-rice * pd-amount; all+= total; printf(%9.3f|n, total); pd = pd-next; while(pd!=NULL); prin
30、tf(t*n); printf(t 仓库货品总价值量为:%12.3f 元n, all); printf(t*n); / getch();void menu_store( struct Product *head ) int select; for(;) printf(t*n); printf(tt 算法与数据结构课程设计-仓库货品管理n); printf(t*n); printf(tttt1.货品出库n); printf(tttt2.货品进库n); printf(tttt0.返 回n); printf(t*n); printf(请选择操作:); scanf(%d, &select);
31、switch(select) case 0: return; case 1: head = outstore(head); break; case 2: head = instore(head); void menu_check( struct Product *head ) int select; for(;) printf(t*n); printf(tt 算法与数据结构课程设计-仓库货品管理n); printf(t*n); printf(tttt1.按编号查询n); printf(tttt2.按名称查询n); printf(tttt0.返 回n); printf(t*n); printf(
32、请选择操作:); scanf(%d, &select); switch(select) case 0: return; case 1: checkbynumber( head ); break; case 2: checkbyname( head ); void *menu_exit( struct Product *head ) int select; printf(t*n); printf(tt 算法与数据结构课程设计-仓库货品管理n); printf(t*n); printf(退出时是否保存数据?0:保存;1:不保存); scanf(%d, &select); switc
33、h(select) case 0: savedata( head );exit(0); break; case 1: exit(0); return 0;struct Product *menu_init( struct Product *head ) int select; printf(t*n); printf(tt 算法与数据结构课程设计-仓库货品管理n); printf(t*n); printf(tttt1.新建仓库n); printf(tttt2.打开仓库n); printf(tttt3.添加货品n); printf(tttt4.修改货品n); printf(tttt5.删除货品n)
34、; printf(tttt6.库存管理n); printf(tttt7.货品查询n); printf(tttt8.储存数据n); printf(tttt9.所有货品n); printf(tttt0.退出系统n); printf(t*n); printf(请选择操作:); scanf(%d, &select); switch(select) case 0:menu_exit( head ); break; case 1:head = newstore(); break; case 2:head = openstore(); break; case 3:addproduct( head )
35、; break; case 4:editproduct( head ); break; case 5:head = delproduct( head ); break; case 6:menu_store( head ); break; case 7:menu_check( head ); break; case 8:savedata( head ); break; case 9:listall( head ); return head;/*程序主函数*/int main() struct Product *head; head = NULL; for(;) head = menu_init(
36、 head ); return 0; 总总 结结 课程设计是一个相当好的实践环节,通过这短短的一个星期的课程设计,我觉得从中获得到的东西,比上了整个学期的课程学的东西还多,实践是一个有效提高自己编程能力的方法。在这个课程设计项目中,我运用了链表和文件的读写等知识点,而这些都是老师还没有教的,在课程设计实习周中,我用了前半部分的时间仔细了看了链表和文件读写的章节,了解其功能设计,通过不断的调试总结出链表的规律与使用方法。将链表和指针的应用提高到另一个层次。在这一次课程设计中,我学会了怎么去写好一个规范的设计文档,熟悉流程图的制作过程。在调试的过程中,出现了一些不可以预料的程序错误,这又让我学会了
37、如何去设置断点,进行单步调试,分析清楚错误出现的原因,及其找到解决错误的方法。同时,本次课程设计我分别用了不用的 C 编译器去编译代码,发觉不同编译器编译效果的不同,以及库文件等的不同。学会在不同的编译环境中使用不同的函数。参考文献参考文献1 严蔚敏,吴伟民著.数据结构(C 语言版)M.北京:清华大学出版社, 1997.4. 2 刘大有.数据结构M.北京:高教出版社,2001. 3 黄梯云.管理信息系统(修订版)M.北京:高等教育出版社,2000 年.4 齐德昱.算法与数据结构M.北京:清华大学出版社,2003.10.5 徐孝凯,贺桂英著.C 语言教程M.北京:清华大学出版社,2004.致致
38、谢谢 本人在此向所有关心我的及帮助我的老师和同学们致以最真诚的感谢。在本次课程设计中,我从指导老师及同学身上学到了很多东西。她认真负责的工作态度,严谨的治学精神和深厚的理论水平都使我受益匪浅。她无论在理论上还是在实践中,都给与我很大的帮助,使我得到很大的提高,这对于我以后的工作和学习都有一种巨大的帮助,在此感谢她耐心的辅导。 附件附件 部分源程序代部分源程序代#include #include /*#include */#include #include #define Length sizeof( struct Product )/*定义货品结构体*/struct Product int n
39、um; char name20; float rice; int amount; struct Product *next;void cls( void ) int i; for( i=0; inext = (struct Product *)malloc( Length ); if( pd-next = NULL ) printf(内存溢出n); / getch(); return(h); q = pd; pd = pd-next; q-next = NULL; fclose( fp ); printf(成功打开仓库数据文件n); / getch(); return(h);int saved
40、ata( struct Product *head ) char filename255; struct Product *pd; FILE *fp; pd = head; printf(请输入要保存的仓库数据文件名(如:store,0 取消):n); scanf(%s, &filename); if( filename0 = 0 ) return 1; if( (fp=fopen(filename, wb) ) = NULL ) printf(储存文件出错n); / getch(); return 1; printf(正在储存数据.n); while( pd!=NULL ) fwri
41、te( pd, Length, 1, fp); pd = pd-next; fclose( fp ); printf(仓库数据保存成功n); / getch(); return 0;/*/创建链表,新建一个仓库,并输入数据/返回链表*/struct Product *newstore() struct Product *h = NULL, *pd; for(;) pd = (struct Product *)malloc( Length ); if (!pd) printf(内存溢出!n); / getch(); return NULL; printf(请输入货品编号(0 退出):n); sc
42、anf(%d, &pd-num); if( pd-num = 0 ) break; printf(请输入货品名称:n); scanf(%s, &pd-name); printf(请输入货品价格:n); scanf(%f, &pd-rice); printf(请输入货品库存量:n); scanf(%d, &pd-amount ); printf(n); pd-next = h; h = pd; return(h);/*/添加货品,向链表末尾添加货品/参数:*head 链表指针/返回添加货品的链表*/struct Product *addproduct( struc
43、t Product *head ) struct Product *h, *pd; if( !head ) printf(请先创建或打开仓库n);return head; else h = head; for(;) pd = (struct Product *)malloc( Length ); if (!pd) printf(内存溢出!n); / getch(); break; printf(请输入货品编号(0 退出):n); scanf(%d, &pd-num); if( pd-num = 0 ) break; printf(请输入货品名称:n); scanf(%s, &p
44、d-name); printf(请输入货品价格:n); scanf(%f, &pd-rice); printf(请输入货品库存量:n); scanf(%d, &pd-amount ); printf(n); while( h-next!=NULL ) h = h-next; h-next = pd; pd-next = NULL; return(h);/*/按编号查找货品/参数:*head 链表指针,*num 货品编号/返回:链表结点*/struct Product *bynumber( struct Product *head, int num ) float total;
45、int n = num; struct Product *pd; pd = head; while( pd!=NULL&pd-num!=n) pd = pd-next; if( pd = NULL) printf(没有该编号货品。n); / getch(); else printf(t*按编号查询货品*n); printf(t| 编号 | 名称 | 价格 | 库存 | 价值量 |n); printf(t|-|-|-|-|-|n); printf(t|%6d|%-13s|%9.3f|%8d|, pd-num, pd-name, pd-rice, pd-amount); total = p
46、d-rice * pd-amount; printf(%9.3f|n, total); printf(t*n); / getch(); return(pd);/*/按名称查找货品/参数:*head 链表指针,*name 货品名称/返回:链表结点*/struct Product *byname( struct Product *head, char name20 ) float total; struct Product *pd; pd = head; while( pd!=NULL&strcmp(pd-name, name)!=0) pd = pd-next; if( pd = NUL
47、L) printf(没有该名称货品。n); / getch(); else printf(t*按名称查询货品*n); printf(t| 编号 | 名称 | 价格 | 库存 | 价值量 |n); printf(t|-|-|-|-|-|n); printf(t|%6d|%-18s|%9.3f|%8d|, pd-num, pd-name, pd-rice, pd-amount); total = pd-rice * pd-amount; printf(%9.3f|n, total); printf(t*n); / getch(); return(pd); void *checkbynumber(
48、struct Product *head ) struct Product *h = head; int num; printf(请输入查询编号(0 退出):n); scanf(%d, &num); return bynumber( h, num); void *checkbyname( struct Product *head ) struct Product *h = head; char name20; printf(请输入货品名称(0 退出):n); scanf(%s, &name); return byname( h, name);/*/修改货品/参数:*head 链
49、表指针/返回:链表结点*/struct Product *editproduct( struct Product *head ) int num; struct Product *h, *pd; h = head; for(;) pd = (struct Product *)malloc( Length ); if (!pd) printf(内存溢出!n); / getch(); break; printf(请输入要修改的货品编号:(0 退出)n); scanf(%d, &num); if( num = 0 ) break; pd = bynumber( h, num); if( pd
50、 = NULL) break; printf(请输入货品新名称:n); scanf(%s, &pd-name); printf(请输入货品新价格:n); scanf(%f, &pd-rice); printf(n); return(h);struct Product *delproduct( struct Product *head ) int num; char confirm; struct Product *h, *q, *pd; pd = q = h = head; for(;) printf(请输入要删除的货品编号:(0 退出)n); scanf(%d, &n
51、um); if( num = 0 ) break; while( pd!=NULL&pd-num!=num) q = pd; pd = pd-next; if( pd = NULL) printf(没有该编号货品。n); else bynumber( h, num); / getch(); if(pd=h) /*如果 p=h,说明被删结点是头结点*/ h=pd-next; /*修改头指针指向下一条记录*/ else q-next=pd-next; printf(删除成功n); return(h);/*/货品进库出库/参数:*head 链表指针, *outin 为进库出库类型,0 表示出
52、库/返回:链表结点*/struct Product *outinstore( struct Product *head, int outin ) int num, outnum; struct Product *h, *pd; h = head; for(;) pd = (struct Product *)malloc( Length ); if (!pd) printf(内存溢出!n);/ getch(); break; printf(请输入要修改的货品编号:(0 退出)n); scanf(%d, &num); if( num = 0 ) break; pd = bynumber(
53、h, num); if(!pd) break; if( outin = 0) printf(请输入货品出库数量:n); scanf(%d, &outnum); pd-amount = pd-amount - outnum; else printf(请输入货品进库数量:n); scanf(%d, &outnum); pd-amount = pd-amount + outnum; printf(n); return(h);/*/货品出库*/struct Product *outstore(struct Product *head) struct Product *h = head;
54、 return outinstore(h, 0);/*/货品进库 */struct Product *instore(struct Product *head) struct Product *h = head; return outinstore(h, 1); void listall( struct Product *head) float total=0, all=0; struct Product *pd; pd = head; if( pd = NULL ) cls(); printf(错误:当前未打开任何仓库n); / getch(); return; cls(); printf(t*仓库内所有货品*n); printf(tt| 编号 | 名称 | 价格 | 库存 | 价值量 |n); printf(tt|-|-|-|-|-|n); do printf(tt|%6d|%-13s|%9.3f|%8d|, pd-num, pd-name, pd-rice, pd-amount); total = pd-rice * pd-amount; all+= total; printf(%9.3f|n, total); pd = pd-next; while(pd!=NU
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 综合素养提升的跨领域学习策略研究
- 科技驱动的校园环境改善策略
- IT行业保密协议(2024版)
- 2025年度智能厨电一体化购销合同二零二五3篇
- 二零二五年度自助餐厅经营承包合同3篇
- 漯河2024年河南漯河市沙澧河建设运行保障中心人才引进5人笔试历年参考题库附带答案详解
- 滁州安徽滁州明光市司法局招聘司法协理员7人笔试历年参考题库附带答案详解
- 高效能实验的关键仪器的科学使用方法
- 淮安2025年江苏淮安涟水县公安局警务辅助人员招聘87人(一)笔试历年参考题库附带答案详解
- 二零二五年度虫草产品研发与创新合同3篇
- 2024年小升初语文入学分班测试卷四(统编版)
- 流行文化对青少年价值观的影响研究
- 2024年代理记账工作总结6篇
- 电气工程预算实例:清单与计价样本
- VOC废气治理工程中电化学氧化技术的研究与应用
- 煤矿机电设备培训课件
- 科技论文图表等规范表达
- 高考写作指导议论文标准语段写作课件32张
- 2021年普通高等学校招生全国英语统一考试模拟演练八省联考解析
- 红色研学旅行课程的设计与实践
- 幼儿园保育教育质量指南评估指标考核试题及答案
评论
0/150
提交评论