收藏 分销(赏)

C语言仓库管理系统.doc

上传人:人****来 文档编号:3635828 上传时间:2024-07-11 格式:DOC 页数:29 大小:38.50KB
下载 相关 举报
C语言仓库管理系统.doc_第1页
第1页 / 共29页
C语言仓库管理系统.doc_第2页
第2页 / 共29页
C语言仓库管理系统.doc_第3页
第3页 / 共29页
C语言仓库管理系统.doc_第4页
第4页 / 共29页
C语言仓库管理系统.doc_第5页
第5页 / 共29页
点击查看更多>>
资源描述

1、C语言仓库管理系统292020年4月19日文档仅供参考题目是: 设计一个简单的仓储管理系统,要求具有基本的操作功能:插入(添加)、删除、查找、修改和统计。 业务简介 1.采购人员将采购物资清单交与财务人员,其中包含一些必要的数据.财务人员据此作帐,将数据记入,并开一张票据,交与采购人员实现物资入库. 2.当有物资卖出时,即物资出库,财务人员会查阅当前此类货物的库存情况,如此类货物还有存量,且有不同的出价时,财务人员会根据情况,调出相应价的货物. 由于市场行情时常波动,管理人员可能会据此对物资做出相应的调价. 3.当货物出现问题,需要退给供货商,并把退还的货物名,数量,金额,记录下来. 4.到一

2、定时期的时候,例如月底,年终,需要将各种物资的出入库,库存金额整理出来,以便为管理人员提供详尽,可靠的数据,为下一步制定目标方案提供依据. 2、1数据结构 用4个结构数组(或链表)来存储下述4类信息,每类信息的每条记录用结构类型自定义: 1商品信息:商品编号、商品名、型号/规格、数量、进货价、销售价 2入库信息:入库编号、商品编号、入库商品名、入库数量、入库价格、总价 3出库信息:出库编号、商品编号、出库商品名、出库数量、出库价格、总价 4退货信息:退货编号、商品编号、退还货物名、退货数量、退货价格、总价 2、2设计要求 5.对以上每类信息建立数据结构 6.对以上每类信息进行插入操作 7.对以

3、上每类信息进行删除操作 8.对以上每类信息进行修改操作 9.对以上每类信息进行查找操作(查找关键字用下划线标出) 10.数据统计; i.统计入库商品的总数及总价: ii.统计出库商品的总数及总价: iii.统计仓库中现有商品的总数及总价格: #include #include structproduct charp_num12; charname12; charspec12; intamount; intprice; ints_price; structproduct*next; ; structproduct*head; structin_product charnum12; charp_n

4、um12; charname12; intamount; intprice; intt_price; structin_product*next; ; structin_product*ihead; structout_product charnum12; charp_num12; charname12; intamount; intprice; intt_price; structout_product*next; ; structout_product*ohead; structquit_product charnum12; charp_num12; charname12; intamou

5、nt; intprice; intt_price; structquit_product*next; ; structquit_product*qhead; intinit() head=ihead=ohead=qhead=NULL; printf(0:Quitn); printf(1:Entertheinformationofinproductn); printf(2:Entertheinformationofoutproductn); printf(3:Entertheinformationofquitproductn); printf(4:Totaltheinformationofpro

6、ductn); intmenu() printf(1:insertdatan); printf(2:deletedatan); printf(3:modifydatan); printf(4:selectdatan); printf(Othertoquitn); intmenu2() printf(0:Quitn); printf(1:Entertheinformationofinproductn); printf(2:Entertheinformationofoutproductn); printf(3:Entertheinformationofquitproductn); printf(4

7、:Totaltheinformationofproductn); intinsert_product() structproduct*p1,*p; p1=(structproduct*)malloc(sizeof(structproduct); p=head; if(p=NULL)/*开始没有数据*/ printf(Enterthedataofproductn); printf(Includethespbh,name,style,num,price,sale_priceofproductn); scanf(%s%s%s%d%d%d, &p1-p_num,&p1-name,&p1-spec,&p

8、1-amount,&p1-price,&p1-s_price);head=p1; head-next=NULL; return0; while(p-next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/ p=p-next; p-next=p1; printf(Enterthedatan); scanf(%s%s%s%d%d%d, &p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price); p1-next=NULL; intin_insert() structin_product*p1,*p; p1=(structin

9、_product*)malloc(sizeof(structin_product); p=ihead; if(p=NULL)/*开始没有数据*/ printf(Enterthedataofinproductn); printf(Includetherkbh,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; return0; while(p-next!=N

10、ULL)/*把指针移到链表末端,在链表末端插入数据*/ p=p-next; p-next=p1; printf(Enterthedatan); scanf(%s%s%s%d%d%d, &p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price); p1-next=NULL; intin_modify() charm_num12; structin_product*p; p=ihead; printf(Enterthemodifynumn); scanf(%s,&m_num); if(p=NULL)/*开始没有数据*/ printf(S

11、orry!Nodatacanbefoundn); return0; while(p!=NULL) if(strcmp(p-num,m_num)=0) printf(Enterthenewdatawithoutnumn); scanf(%s%s%d%d%d, &p-p_num,&p-name,&p-amount,&p-price,&p-t_price); printf(Onedatahadmodifiedn); return0; p=p-next; printf(Sorry!Nonumhasfoundn); intin_select() chars_num12; structin_product

12、*p; p=ihead; printf(Entertheselectnumn); scanf(%s,&s_num); while(p!=NULL) if(strcmp(p-num,s_num)=0) printf(Thedatayouwantis:n); printf(%s%s%s%d%d%dn, p-num,p-p_num,p-name,p-amount,p-price,p-t_price); return0; p=p-next; printf(Sorry!Nonumhasfoundn); intin_delete() chard_num12; structin_product*p1,*p;

13、 p=ihead; printf(Enterthedeletenumn); scanf(%s,&d_num); if(p=NULL)/*开始没有数据*/ printf(Nodatacanbefoundn); return0; if(strcmp(p-num,d_num)=0&p-next=NULL)/*链表只有一个数据,且是要删除的*/ ihead=NULL; printf(Onedatahasbeendeletedn); return0; if(strcmp(p-num,d_num)=0&p-next!=NULL)/*要删除的数据在链表的头上*/ ihead=ihead-next; prin

14、tf(Onedatahasbeendeletedn); return0; while(p-next!=NULL) p1=p-next; if(strcmp(p1-num,d_num)=0) p-next=p1-next; printf(Onedatahasbeendeletedn); return0; p=p-next; printf(Sorry!Nonumhasfoundn); intout_insert() structout_product*p1,*p; p1=(structout_product*)malloc(sizeof(structout_product); p=ohead; i

15、f(p=NULL)/*开始没有数据*/ printf(Enterthedataofoutproductn); printf(Includetheckbh,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; return0; while(p-next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/ p=p-next; p-next=p1; pri

16、ntf(Enterthedatan); scanf(%s%s%s%d%d%d, &p1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price);p1-next=NULL; intout_modify() charm_num12; structout_product*p; p=ohead; printf(Enterthemodifynumn); scanf(%s,&m_num); if(p=NULL)/*开始没有数据*/ printf(Sorry!Nodatacanbefoundn); return0; while(p!=NULL) if

17、(strcmp(p-num,m_num)=0) printf(Enterthenewdatawithoutnumn); scanf(%s%s%d%d%d, &p-p_num,&p-name,&p-amount,&p-price,&p-t_price); printf(Onedatahadmodifiedn); return0; p=p-next; printf(Sorry!Nonumhasfoundn); intout_select() chars_num12; structout_product*p; p=ohead; printf(Entertheselectnumn); scanf(%s

18、,&s_num); while(p!=NULL) if(strcmp(s_num,p-num)=0) printf(Thedatayouwantis:n); printf(%s%s%s%d%d%dn, p-num,p-p_num,p-name,p-amount,p-price,p-t_price); return0; p=p-next; printf(Sorry!Nonumhasfoundn); intout_delete() chard_num12; structout_product*p1,*p; p=ohead; printf(Enterthedeletenumn); scanf(%s,

19、&d_num); if(p=NULL)/*开始没有数据*/ printf(Nodatacanbefoundn); return0; if(strcmp(p-num,d_num)=0&p-next=NULL)/*链表只有一个数据,且是要删除的*/ ohead=NULL; printf(Onedatahasbeendeletedn); return0; if(strcmp(p-num,d_num)=0&p-next!=NULL)/*要删除的数据在链表的头上*/ ohead=ohead-next; printf(Onedatahasbeendeletedn); return0; while(p-ne

20、xt!=NULL) p1=p-next; if(strcmp(p1-num,d_num)=0) p-next=p1-next; printf(Onedatahasbeendeletedn); return0; p=p-next; printf(Sorry!Nonumhasfoundn); intquit_insert() structquit_product*p1,*p; p1=(structquit_product*)malloc(sizeof(structquit_product); p=qhead; if(p=NULL)/*开始没有数据*/ printf(Enterthedataofqu

21、itproductn); printf(Includethethbh,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; return0; while(p-next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/ p=p-next; p-next=p1; printf(Enterthedatan); scanf(%s%s%s%d%d%d, &p

22、1-num,&p1-p_num,&p1-name,&p1-amount,&p1-price,&p1-t_price); p1-next=NULL; intquit_modify() charm_num12; structquit_product*p; p=qhead; printf(Enterthemodifynumn); scanf(%s,&m_num); if(p=NULL)/*开始没有数据*/ printf(Sorry!Nodatacanbefoundn); return0; while(p!=NULL) if(strcmp(p-num,m_num)=0) printf(Enterthe

23、newdatawithoutnumn); scanf(%s%s%d%d%d, &p-p_num,&p-name,&p-amount,&p-price,&p-t_price); printf(Onedatahadmodifiedn); return0; p=p-next; printf(Sorry!Nonumhasfoundn); intquit_select() chars_num12; structquit_product*p; p=qhead; printf(Entertheselectnumn); scanf(%s,&s_num); while(p!=NULL) if(strcmp(s_

24、num,p-num)=0) printf(Thedatayouwantis:n); printf(%s%s%s%d%d%dn, p-num,p-p_num,p-name,p-amount,p-price,p-t_price);return0; p=p-next; printf(Sorry!Nonumhasfoundn); intquit_delete() chard_num12; structquit_product*p1,*p; p=qhead; printf(Enterthedeletenumn); scanf(%s,&d_num); if(p=NULL)/*开始没有数据*/ printf

25、(Nodatacanbefoundn); return0; if(strcmp(p-num,d_num)=0&p-next=NULL)/*链表只有一个数据,且是要删除的*/ qhead=NULL; printf(Onedatahasbeendeletedn); return0; if(strcmp(p-num,d_num)=0&p-next!=NULL)/*要删除的数据在链表的头上*/ qhead=qhead-next; printf(Onedatahasbeendeletedn); return0; while(p-next!=NULL) p1=p-next; if(strcmp(p1-nu

26、m,d_num)=0) p-next=p1-next; printf(Onedatahasbeendeletedn); return0; p=p-next; printf(Sorry!Nonumhasfoundn); inttotal() intin_num=0,in_price=0; intout_num=0,out_price=0; intnum=0,price=0; structin_product*ip; structout_product*op; structproduct*p; ip=ihead; while(ip!=NULL) in_num+=ip-amount; in_pric

27、e+=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(Theinproductstotalnumberandtotalpriceis:n); printf(%d%dn,in_num,in_price); printf(Theoutproductstotalnumberandtotalpric

28、eis:n); printf(%d%dn,out_num,out_price); printf(Theproductstotalnumberandtotalpriceis:n); printf(%d%dn,num,price); intin_case() intchoice; printf(Theinformationofinproduct:n); while(1) printf(Enterthechoicen); scanf(%d,&choice); switch(choice) case1:in_insert();insert_product();break; case2:in_delet

29、e();break; case3:in_modify();break; case4:in_select();break; default:return0; menu(); intout_case() intchoice; printf(Theinformationofoutproduct:n); while(1) printf(Enterthechoicen); scanf(%d,&choice); switch(choice) case1:out_insert();break; case2:out_delete();break; case3:out_modify();break; case4

30、:out_select();break; default:return0; menu(); intquit_case() intchoice; printf(Theinformationofquitproduct:n); while(1) printf(Enterthechoicen); scanf(%d,&choice); switch(choice) case1:quit_insert();break; case2:quit_delete();break; case3:quit_modify();break; case4:quit_select();break; default:return0; menu(); intmain() intchoice; init(); while(1) scanf(%d,&choice); switch(choice) case0:return0; case1:menu();in_case();break; case2:menu();out_case();break; case3:menu();quit_case();break; case4:total();break; menu2();

展开阅读全文
部分上传会员的收益排行 01、路***(¥15400+),02、曲****(¥15300+),
03、wei****016(¥13200+),04、大***流(¥12600+),
05、Fis****915(¥4200+),06、h****i(¥4100+),
07、Q**(¥3400+),08、自******点(¥2400+),
09、h*****x(¥1400+),10、c****e(¥1100+),
11、be*****ha(¥800+),12、13********8(¥800+)。
相似文档                                   自信AI助手自信AI助手
搜索标签

当前位置:首页 > 通信科技 > 开发语言

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服