2014年仓库管理系统(面向对象课程设计)(可编辑)
- 格式:pdf
- 大小:255.25 KB
- 文档页数:25
2014年仓库管理系统(面向对象课程设计)
*******************
实践教学
*******************
兰州理工大学
计算机与通信学院
2011年秋季学期
面向对象课程设计
题目: 仓库管理系统
专业班级: 计算机科学与技术一班
姓名: 海发明学号: 10240102
指导教师: 年福忠成绩:_______________
目录
摘要
序言
正文
1.采用类c++语言定义相关的数据类型
2.各模块的伪码算法.
3.函数的调用关系图
4.调试分析
5.测试结果
6.源程序带注释
总结
参考文献
致谢
附件部分源程序代码
摘要
本程序主要介绍了小型仓库货品管理的设计与基本功能的实现。
通过对仓库基本功能的分析,该程序实现了对小型仓库管理的基本操作。
设计要求主要是货品入库、出库、增加、删除、查找及显示库存量等最基本功能操作。
在课程设计过程中,对问题的所采用的数据结构和算法分析,及程序设计语言采用VC++,程序运行的平台WindowsXPvisual C++6.0,逐步对基本要求进行分布实现,在设计中采用单链表和文件对录入的基本数据进行存储,最终对产品进行的基本操作如产品入库、出库及查找都基本以实现。
关键字:c++,结构体,软件,插入;
序言现代科学技术的飞速发展,改变了世界,也改变了人类的生活,作为新世纪的大学生,应当站在时代发展的前列,掌握现代科学技术知识,调整自己的知识结构和能力结构,以适应社会发展的要求。
掌握计算机知识和应用,无疑是培养新型人才的一个重要环节。
对于我们计算机专业的学生来说,想要把所学知识用于实践,课程设计是一个很好的环节,课程设计不仅提高了我们的设计能力和操作能力,加深理解了数据的逻辑结构、存储结构,掌握线性表上基本运算的实现,进一步理解和熟练掌握课本中所学的各种数据结构,而且学会了如何把学到的知识用于解决实际问题。
通过本次课程设计的制作,能让我们对数据结构以及程序设计有更深的体会,流程图的建立能提高我们系统分析问题的能力,从而灵活的驾驭整个程序的运行,对于具体问题,找出具体的解决方案或是多种解决方案,增强我们的创新能力。
正文
采用类c++语言定义相关的数据类型
menu_init
+新建仓库 newstore
+打开仓库 openstore
+添加货物 addproduct
+修改货物 editproduct
+删除货物 delproduct
+库存管理 menu_store
-货物出库 instore
-货物进库 outstore
+货物查询 menu_check+按编号查询 bynumber+按名称查询 byname +储存数据 savedata
+所有货物 listall
+退出系统 exit
1.2数据设计
商品结构体设计:
struct Product
int num; char name[20]; float price; int amount; char fac[50]; char buss[50];struct *next;
;
2各模块的伪码算法:
2.1菜单类:
menu_init;
说明:初始化界面
menu_store;
说明:库存管理界面
menu_check;
说明:货物查询界面
menu exit;
说明:退出界面
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 ;
说明: 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 为商品编号功能:按编号查询商品
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 ;
说明: 换行
功能:换行
函数的调用关系图:
四、五、调试分析与结果:
1 程序运行时初始界面
2 新建仓库
用键盘输入1,程序调用新建仓库功能函数,要求用户输入货物编号,货物名称,货物价格等。
3 打开仓库文件
用键盘输入2,程序调用打开仓库文件功能函数,要求用户输入仓库数据文件名,数据文件存在,显示打开成功。
4 添加货物
用键盘输入3,程序调用添加货物功能函数,要求用户输入货物编号,货物名称,货物价格等。
5 修改货物
用键盘输入4,程序调用修改货物功能函数,要求用户输入货物编号,货物存在,显示货物详细信息,按任意键后,要求用户输入新货物名称,货物价格等。
6 删除货物
用键盘输入5,程序调用删除货物功能函数,要求用户输入货物编号,货物存在,显示货物详细信息,按任意键后,删除货物。
7 库存管理:
用键盘输入6,程序调用库存管理功能函数,显示库存管理子页面,选择2,货物出库,要求用户输入货物编号,货物存在,显示货物详细信息,要求用户输入进库数量。
8 货物查询
用键盘输入7,程序调用货物查询功能函数,显示货物查询子页面,选择1,按编号查询,要求用户输入货物编号,货物存在,显示货物详细信息。
货若物不存在,显示“没有该编号货物”。
9 储存数据
用键盘输入8,程序调用储存数据功能函数,要求用户输入文件名,将数据储存在指定文件中。
10 所有货物
用键盘输入9,程序调用所有货物功能函数,显示仓库内所有货物。
11 退出系统
用键盘输入0,程序调用货退出系统功能函数,显示提示保存信息。
6.源程序带注释:
#include
#include
#include
#include
#define Length sizeof struct Product
struct Product //定义货品结构体
int num;//编号char name[20];//名称float price;//价格int amount;//库存数量
char fac[50];//生产厂家
char buss[50]; //提供商家 struct Product *next;
;
void cls void
int i; for i0; i1; i++printf"\n";
//打开仓库,从把文件数据读入链表返回链表
struct Product *openstore
char filename[255]; struct Product *h, *pd, *q; FILE *fp; h NULL; printf"请输入要打开的仓库数据文件如:////0>. scanf"%s", &filename; if filename[0] '0' return h; if fpfopenfilename, "rb" NULL printf"打开文件出错\n"; // getch;return h; printf"正在打开文件\n"; pd struct Product *malloc Length ; if pd NULL printf"内存溢出\n"; // getch;returnh; h pd; while !feoffp iffscanffp,"%d\t%s\t%f\t%d\t%s\t%s\n",&pd-num,&pd-name,&pd-price,&pd-
amount,&pd-fac,&pd-bussNULLbreak;pd-next struct Product *malloc Length ;if pd-next NULL printf"内存溢出\n"; // getch; returnh;q pd;pd pd-next; q-next NULL; fclose fp ; printf"成功打开仓库数据
文件\n"; // getch; returnh;
int savedata struct Product *head
char filename[255]; struct Product *pd; FILE *fp; pd head; printf"请输入要保存的仓库数据文件名如:////. scanf"%s", &filename; if filename[0] '0'
return 1; if fpfopenfilename, "wb" NULL printf"储存文件出错
\n"; // getch;return 1; printf"正在储存数据\n"; while pd!NULL fprintf fp, "%d\t%s\t%f\t%d\t%s\t%s\n",pd-num,pd-name,pd-price,pd-amount,pd-fac,p
d-buss;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";scanf"%d", &pd-num;if pd-num 0
break;printf"请输入货品名称:\n";scanf"%s", &pd-name;printf"请输入
货品价格:\n";scanf"%f", &pd-price;printf"请输入货品库存
量:\n";scanf"%d", &pd-amount ;
printf"请输入货品的生产厂家:\n";
scanf"%s",&pd-fac;
printf"请输入货品的提供商家:\n";
scanf"%s",&pd-buss;printf"\n";pd-next h;h pd; returnh;
//添加货品,向链表末尾添加货品
//参数:*head链表指针
//返回添加货品的链表
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 0 break;printf"请输入货品名称:\n";scanf"%s", &pd-name;printf"请输入货品价格:\n";scanf"%f", &pd-price;printf"请输入货品库存量:\n";scanf"%d", &pd-amount ;
printf"请输入货品的生产厂家:\n";
scanf"%s",&pd-fac;
printf"请输入货品的提供商家:\n";
scanf"%s",&pd-buss;printf"\n";while h-next!NULL h h-next;h-next pd;pd-next NULL; returnh;
//按编号查找货品
//参数:*head链表指针,*num货品编号
//返回:链表结点
struct Product *bynumber 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"********************按编号查询货品**************************************\n";printf"| 编号 | 名称 |价格| 库存| 生产厂家| 提供商家| 价值量|\n";printf"|------|-------------|---------|--------|----------|----------|----------|\n";printf"|%6d|%-13s|%-9.3f|%-8d|%-10s|%-10s|",pd-n um,pd-name,pd-price,pd-amount,pd-fac,pd-buss;total pd-price * pd-amount;printf"%-10.3f|\n",
total;printf"********************************************************
****************\n"; // getch; returnpd;
//按名称查找货品
//参数:*head链表指针,*name货品名称
//返回:链表结点
struct Product *byname struct Product *head, char name[20]
float total; struct Product *pd; pd head; while pd!NULL&&strcmppd-name, name!0//查找货品 pd pd-next; if pd NULL printf"没有该名称货品。
\n"; // getch; else printf"*********************按名称查询货品
**************************************\n";printf"| 编号 | 名称 |价格
| 库存| 生产厂家| 提供商家| 价值量
|\n";printf"|------|-------------|---------|--------|----------|-----
-----|---------|\n";printf"|%6d|%-13s|%-9.3f|%-8d|%-10s|%-10s|",
pd-num, pd-name, pd-price, pd-amount,pd-fac,pd-buss;total pd-price * pd-amount;printf"%-10.3f|\n",
total;printf"********************************************************
****************\n"; // getch; returnpd;
void *checkbynumber struct Product *head
struct Product *h head; int num; printf"请输入查询编号0退出:\n"; scanf"%d", # return bynumber h, num;
void *checkbyname struct Product *head
struct Product *h head; char name[20]; printf"请输入货品名称0
退出:\n"; scanf"%s", &name; 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", #if num 0 break;pd bynumber h, num;if pd NULL
break;printf"请输入货品新名称:\n";scanf"%s", &pd-name;printf"请输入货品新价格:\n";scanf"%f", &pd-price;printf"\n"; returnh;
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", #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; ifpdh//如果ph,说明被删结点是头结点 hpd-next; //修改头指针指向下一条记录 else q-nextpd-next; printf"删除成功\n"; returnh;
//货品进库出库//参数:*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", #if num 0
break;pd bynumber h, num;if!pdbreak;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"; returnh;
//货品出库
struct Product *outstorestruct Product *head
struct Product *h head; return outinstoreh, 0;
//货品进库
struct Product *instorestruct Product *head
struct Product *h head; return outinstoreh, 1;
void listall struct Product *head
float total0, all0; struct Product *pd; pd head; if pd NULL cls;printf"错误:当前未打开任何仓库\n";//getch;return; cls; printf"**************************仓库内所有货品
*******************************\n";printf"| 编号 | 名称 |价格 | 库
存| 生产厂家| 提供商家| 价值量
|\n";printf"|------|-------------|---------|--------|----------|-----
-----|----------|\n"; do printf"|%6d|%-13s|%-9.3f|%-8d|%-10s|%-10s|", pd-num, pd-name, pd-price, pd-amount,pd-fac,pd-buss;total pd-price * pd-amount;all+ total;printf"%-10.3f|\n", total;pd pd-next; whilepd!NULL; printf"**************************************************************
\n"; printf"仓库货品总价值量为:%12.3f元\n", all; printf"**************************************************************
\n"; // getch;
void menu_store struct Product *head
int select; for;; printf"\t*******************************************************\n";
printf"\t\tC++面向对象技术课程设计-仓库货品管理\n"; printf"\t*******************************************************\n"; printf"\t\t\t\t1.货品出库\n"; printf"\t\t\t\t2.货品进库\n"; printf"\t\t\t\t0.返回\n"; printf"\t*******************************************************\n"; printf"请选择操作:"; scanf"%d", &select; switchselect case 0: return;case 1: head outstorehead;
break;case 2: head instorehead;
void menu_check struct Product *head
int select; for;; printf"\t*******************************************************\n"; printf"\t\t C++面向对象技术课程设计-仓库货品管理\n"; printf"\t*******************************************************\n"; printf"\t\t\t\t1.按编号查询\n"; printf"\t\t\t\t2.按名称查询\n"; printf"\t\t\t\t0.返回\n"; printf"\t*******************************************************\n"; printf"请选择操作:"; scanf"%d", &select; switchselect case 0: return;case 1: checkbynumber head ;break;case 2: checkbyname head ;
void *menu_exit struct Product *head
int select; printf"\t*******************************************************\n"; printf"\t\t C++面向对象技术课程设计-仓库货品管理\n";
printf"\t*******************************************************\n"; printf"退出时是否保存数据?0:保存;1:不保存"; scanf"%d", &select; switchselect case 0:savedata head ;
exit0;break;case 1:exit0;
return 0;
struct Product *menu_init struct Product *head
int select; printf"\t************************************************************
*\n"; printf"\t\tC++面向对象技术课程设计-仓库货品管理\n"; printf"\t************************************************************
*\n"; printf"\t\t\t\t1.新建仓库\n"; printf"\t\t\t\t2.打开仓库\n"; printf"\t\t\t\t3.添加货品\n"; printf"\t\t\t\t4.修改货品\n"; printf"\t\t\t\t5.删除货品\n"; printf"\t\t\t\t6.库存管理\n"; printf"\t\t\t\t7.货品查询\n"; printf"\t\t\t\t8.储存数据\n"; printf"\t\t\t\t9.所有货品\n"; printf"\t\t\t\t0.退出系统\n"; printf"\t************************************************************
*\n";
printf"注意:在选择操作之前,若没建立仓库,请先进行1和8操作\n"; printf"请选择操作:"; scanf"%d", &select; switchselect case 0:menu_exit head ;
break;case 1:head newstore;
break;case 2:head openstore;break;case 3:addproduct
head ;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 head ;
return 0;
总结课程设计是一个相当好的实践环节,通过这短短的一个星期的课程设计,我觉得从中获得到的东西,比上了整个学期的课程学的东西还多,实践是一个
有效提高自己编程能力的方法。
在这个课程设计项目中,我运用了链表和文件的
读写等知识点,而这些都是老师还没有教的,在课程设计实习周中,我用了前半部
分的时间仔细了看了链表和文件读写的章节,了解其功能设计,通过不断的调试
总结出链表的规律与使用方法。
将链表和指针的应用提高到另一个层次。
在这一次课程设计中,我学会了怎么去写好一个规范的设计文档,熟悉流
程图的制作过程。
在调试的过程中,出现了一些不可以预料的程序错误,这又让我
学会了如何去设置断点,进行单步调试,分析清楚错误出现的原因,及其找到解决
错误的方法。
同时,本次课程设计我分别用了不用的C编译器去编译代码,发觉不同编
译器编译效果的不同,以及库文件等的不同。
学会在不同的编译环境中使用不同
的函数。
参考文献
1]初小璐.完全掌握SQL Server 2000 [M] 机械工业出版社,2004
[2]Jeraod V.Post.数据库管理系统(英文版.第三版)[美]清华大学出版社,2006.1
[3]张海藩.软件工程导论[M].北京:清华大学出版社,1998.1
[4]谢希仁.计算机网络(第二版)[M].北京:电子工业出版社,2003.6
[5]戴志诚,赵国峰.JSP信息化系统建设案例[M].北京:人民邮电出版社,2006.12
[6]成晓静,毕靖.网页设计三剑客完全学习手册[M].北京:中国电力出版社,2004.11
[7]赵强.精通JSP编程[M].北京:电子工业出版社,2006.3
[8]萨师煊,王珊.数据库系统概论[M].北京:高等教育出版社,2002.2
[9]张海藩,李劲,谢兆阳.SQL Server2000数据库设计与系统管理[M].北京:清华大学出版社,2000.9
[10]刘禾,蔡锋.Web数据库假设技巧[M].北京:科技技术出版社,1999.4
[11]徐建波. Internet与Web设计教程[M].北京:中国矿业大学出版社,2000.12
[12]于书举,许向众.数据库设计与开发教程[M].北京:电子工业出版社,2003.11
[13]安海忠,李文斌,林旭新.商业网站建设与管理[M].北京:人民交通出版社,2006.8
[14]T.Umeda and //.-based database for EPR centers in
semiconductors[J].BPhysica B:Condensed Matter,37,249-252,2006.3
[15]Yih-Ling Hedley,Muhammad Younas.Sampling,information extraction and summarisation of Hidden Web databases[J].Data & Knowledge Engineering,In Press,Uncorrected Proof,Available online 10 March 2006.2 致谢我在此向所有关心我的及帮助我的老师和同学们致以最真诚的感谢。
在本次课程设计中,我从指导老师及同学身上学到了很多东西。
他认真负责的工作态度,严谨的治学精神和深厚的理论水平都使我受益匪浅。
无论在理论上还是在实践中,都给与我很大的帮助,使我得到很大的提高,这对于我以后的工作和学习都有一种巨大的帮助,在此感谢指导老师耐心,认真的的辅导。
附件部分源程序代
#include
#include
#include
#include
#define Length sizeof struct Product
struct Product //定义货品结构体
int num;//编号char name[20];//名称float price;//价格int amount;//库存数量
char fac[50];//生产厂家
char buss[50]; //提供商家 struct Product *next;
;
void cls void
int i; for i0; i1; i++printf"\n";
//打开仓库,从把文件数据读入链表返回链表
struct Product *openstore
char filename[255]; struct Product *h, *pd, *q; FILE *fp; h NULL; printf"请输入要打开的仓库数据文件如:////. scanf"%s", &filename; if filename[0] '0' return h; if fpfopenfilename, "rb" NULL printf"
打开文件出错\n"; // getch;return h; printf"正在打开文件\n"; pd struct Product *malloc Length ; if pd NULL printf"内存溢出\n"; // getch;returnh; h pd; while !feoffp if fscanffp, "%d\t%s\t%f\t%d\t%s\t%s\n",&pd-num,&pd-name,&pd-price,&pd-amount,&pd-fac,&pd-bussNULLbreak;pd-next struct Product *malloc Length ;if pd-next NULL printf"内存溢出\n"; // getch; returnh;q pd;pd pd-next; q-next NULL; fclose fp ; printf"成功打开仓库数据文件\n"; // getch; returnh;
int savedata struct Product *head
char filename[255]; struct Product *pd; FILE *fp; pd head; printf"请输入要保存的仓库数据文件名如:////. scanf"%s", &filename; if filename[0] '0'
return 1; if fpfopenfilename, "wb" NULL printf"储存文件出错
\n"; // getch;return 1; printf"正在储存数据\n"; while pd!NULL fprintf fp, "%d\t%s\t%f\t%d\t%s\t%s\n",pd-num,pd-name,pd-price,pd-amount,pd-fac,p
d-buss;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";scanf"%d", &pd-num;if pd-num 0
break;printf"请输入货品名称:\n";scanf"%s", &pd-name;printf"请输入货品价格:\n";scanf"%f", &pd-price;printf"请输入货品库存量:\n";scanf"%d", &pd-amount ;
printf"请输入货品的生产厂家:\n";
scanf"%s",&pd-fac;
printf"请输入货品的提供商家:\n";
scanf"%s",&pd-buss;printf"\n";pd-next h;h pd; returnh;
//添加货品,向链表末尾添加货品
//参数:*head链表指针
//返回添加货品的链表
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 0 break;printf"请输入货品名称:\n";scanf"%s", &pd-name;printf"请输入货品价格:\n";scanf"%f", &pd-price;printf"请输入货品库存量:\n";scanf"%d", &pd-amount ;
printf"请输入货品的生产厂家:\n";
scanf"%s",&pd-fac;
printf"请输入货品的提供商家:\n";
scanf"%s",&pd-buss;printf"\n";while h-next!NULL h h-next;h-next pd;pd-next NULL; returnh;
//按编号查找货品
//参数:*head链表指针,*num货品编号
//返回:链表结点
struct Product *bynumber 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"********************按编号查询货品**************************************\n";printf"| 编号 | 名称 |价格| 库存| 生产厂家| 提供商家| 价值量|\n";printf"|------|-------------|---------|--------|----------|----------|----------|\n";printf"|%6d|%-13s|%-9.3f|%-8d|%-10s|%-10s|",
pd-num, pd-name, pd-price, pd-amount,pd-fac,pd-buss;total pd-price * pd-amount;printf"%-10.3f|\n",
total;printf"********************************************************
****************\n"; // getch; returnpd;
//按名称查找货品
//参数:*head链表指针,*name货品名称
//返回:链表结点
struct Product *byname struct Product *head, char name[20]
float total; struct Product *pd; pd head; while pd!NULL&&strcmppd-name, name!0//查找货品 pd pd-next; if pd NULL printf"没有该名称货品。
\n"; // getch; else printf"*********************按名称查询货品
**************************************\n";printf"| 编号 | 名称 |价格
| 库存| 生产厂家| 提供商家| 价值量
|\n";printf"|------|-------------|---------|--------|----------|-----
-----|---------|\n";printf"|%6d|%-13s|%-9.3f|%-8d|%-10s|%-10s|",
pd-num, pd-name, pd-price, pd-amount,pd-fac,pd-buss;total pd-price * pd-amount;printf"%-10.3f|\n",
total;printf"********************************************************
****************\n"; // getch; returnpd;
void *checkbynumber struct Product *head
struct Product *h head; int num; printf"请输入查询编号0退出:\n"; scanf"%d", # return bynumber h, num;
void *checkbyname struct Product *head
struct Product *h head; char name[20]; printf"请输入货品名称0退出:\n"; scanf。