C语言仓库管理系统.docx

上传人:小飞机 文档编号:3155127 上传时间:2023-03-11 格式:DOCX 页数:16 大小:39.13KB
返回 下载 相关 举报
C语言仓库管理系统.docx_第1页
第1页 / 共16页
C语言仓库管理系统.docx_第2页
第2页 / 共16页
C语言仓库管理系统.docx_第3页
第3页 / 共16页
C语言仓库管理系统.docx_第4页
第4页 / 共16页
C语言仓库管理系统.docx_第5页
第5页 / 共16页
亲,该文档总共16页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《C语言仓库管理系统.docx》由会员分享,可在线阅读,更多相关《C语言仓库管理系统.docx(16页珍藏版)》请在三一办公上搜索。

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

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

3、行修改操作 9. 对以上每类信息进行查找操作 10. 数据统计; i. 统计入库商品的总数及总价: ii. 统计出库商品的总数及总价: iii. 统计仓库中现有商品的总数及总价格: #include #include struct product char p_num12; char name12; char spec12; int amount; int price; int s_price; struct product *next; ; struct product *head; struct in_product char num12; char p_num12; char name1

4、2; int amount; int price; int t_price; struct in_product *next; ; struct in_product *ihead; struct out_product char num12; char p_num12; char name12; int amount; int price; int t_price; struct out_product *next; ; struct out_product *ohead; struct quit_product char num12; char p_num12; char name12;

5、int amount; int price; int t_price; struct quit_product *next; ; struct quit_product *qhead; int init head=ihead=ohead=qhead=NULL; printf(0: Quitn); printf(1: Enter the information of in productn); printf(2: Enter the information of out productn); printf(3: Enter the information of quit productn); p

6、rintf(4: Total the information of productn); 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 productn); printf(2: Enter the information of out productn);

7、 printf(3: Enter the information of quit productn); printf(4: Total the information of productn); int insert_product struct product * p1,* p; p1=(struct product *)malloc(sizeof(struct product); p=head; if (p=NULL)/*开始没有数据*/ printf(Enter the data of productn); printf(Include the spbh,name,style,num,p

8、rice,sale_price of productn); 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-p

9、rice,&p1-t_price); p1-next=NULL; int in_insert struct in_product * p1,* p; p1=(struct in_product *)malloc(sizeof(struct in_product); p=ihead; if (p=NULL)/*开始没有数据*/ printf(Enter the data of in productn); printf(Include the rkbh,spbh,name,number,price,total_pricen); scanf(%s%s%s%d%d%d, &p1-num,&p1-p_n

10、um,&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; str

11、uct in_product * 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); pr

12、intf(One data had modifiedn); return 0; p=p-next; printf(Sorry! No num has foundn); int in_select char s_num12; struct in_product * 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

13、,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_product * 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)=

14、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(On

15、e data has been deletedn); return 0; p=p-next; printf(Sorry! No num has foundn); int out_insert struct out_product * p1,* p; p1=(struct out_product *)malloc(sizeof(struct out_product); p=ohead; if (p=NULL)/*开始没有数据*/ printf(Enter the data of out productn); printf(Include the ckbh,spbh,name,number,pri

16、ce,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_

17、price); p1-next=NULL; int out_modify char m_num12; struct out_product * 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

18、%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_product * p; p=ohead; printf(Enter the select numn); scanf(%s,&s_num); while(p!=NULL) if (strcmp(s_num,p-num)=0) printf(T

19、he 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_product * p1,* p; p=ohead; printf(Enter the delete numn); scanf(%s,&d_num); if (p=NULL)/*开始没有数据*/ printf

20、(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-

21、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_product * p1,* p; p1=(struct quit_product *)malloc(sizeof(struct quit_product); p=qhead; if (p=NULL)/*开始没有数据*/ printf(Enter the data

22、 of quit productn); 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

23、%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_product * 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

24、,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_product * p; p=qhead; printf(Enter the select numn);

25、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_product * p1,* p; p=qhead; printf(

26、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; p

27、rintf(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

28、_product *ip; struct out_product *op; struct product *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 pro

29、ducts total number and total price is:n); printf(%d %dn,in_num,in_price); printf(The out products total number and total price is:n); printf(%d %dn,out_num,out_price); printf(The products total number and total price is:n); printf(%d %dn,num,price); int in_case int choice; printf(The information of

30、in product:n); while(1) printf(Enter the choicen); scanf(%d,&choice); switch(choice) case 1: in_insert;insert_product;break; case 2: in_delete;break; case 3: in_modify;break; case 4: in_select;break; default: return 0; menu; int out_case int choice; printf(The information of out product:n); while(1)

31、 printf(Enter the choicen); scanf(%d,&choice); switch(choice) case 1: out_insert;break; case 2: out_delete;break; case 3: out_modify;break; case 4: out_select;break; default:return 0; menu; int quit_case int choice; printf(The information of quit product:n); while(1) printf(Enter the choicen); scanf

32、(%d,&choice); switch(choice) case 1: quit_insert;break; case 2: quit_delete;break; case 3: quit_modify;break; case 4: quit_select;break; default: return 0; menu; int main int choice; init; while(1) scanf(%d,&choice); switch(choice) case 0: return 0; case 1: menu;in_case; break; case 2: menu;out_case;break; case 3: menu;quit_case;break; case 4:total;break; menu2;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号