C语言仓库管理系统

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

C语言仓库管理系统

题目是:

设计一个简单的仓储管理系统,要求具有基本的操作功能:插入(添加)、删除、查找、修改和统计。

业务简介

1.采购人员将采购物资清单交与财务人员,其中包含一些必要的数据.财务人员据此作帐,将数据记入,并开一张票据,交与采购人员实现物资入库.

2.当有物资卖出时,即物资出库,财务人员会查阅目前此类货物的库存情况,如此类货物还有存量,且有不同的出价时,财务人员会根据情况,调出相应价的货物.

由于市场行情时常波动,管理人员可能会据此对物资做出相应的调价.

3.当货物出现问题,需要退给供货商,并把退还的货物名,数量,金额,记录下来.

4.到一定时期的时候,例如月底,年终,需要将各种物资的出入库,库存金额整理出来,以便为管理人员提供详尽,可靠的数据,为下一步制定目标方案提供依据.

2、1数据结构

用4个结构数组(或链表)来存储下述4类信息,每类信息的每条记录用结构类型自定义:

1.商品信息:商品编号、商品名、型号/规格、数量、进货价、销售价

2.入库信息:入库编号、商品编号、入库商品名、入库数量、入库价格、总价

3.出库信息:出库编号、商品编号、出库商品名、出库数量、出库价格、总价

4.退货信息:退货编号、商品编号、退还货物名、退货数量、退货价格、总价

2、2 设计要求

5. 对以上每类信息建立数据结构

6. 对以上每类信息进行插入操作

7. 对以上每类信息进行删除操作

8. 对以上每类信息进行修改操作

9. 对以上每类信息进行查找操作(查找关键字用下划线标出)

10. 数据统计;

i. 统计入库商品的总数及总价:

ii. 统计出库商品的总数及总价:

iii. 统计仓库中现有商品的总数及总价格:

#include

#include

struct product

{

char p_num[12]; char name[12];

char spec[12];

int amount;

int price;

int s_price;

struct product *next; };

struct product *head;

struct in_product {

char num[12];

char p_num[12];

int amount;

int price;

int t_price;

struct in_product *next; };

struct in_product *ihead;

struct out_product

{

char num[12];

char p_num[12];

char name[12];

int amount;

int price;

int t_price;

struct out_product *next; };

struct out_product *ohead;

struct quit_product

{

char p_num[12];

char name[12];

int amount;

int price;

int t_price;

struct quit_product *next;

};

struct quit_product *qhead;

int init()

{

head=ihead=ohead=qhead=NULL;

printf("0: Quit\n");

printf("1: Enter the information of in product\n ");

printf("2: Enter the information of out product\ n");

printf("3: Enter the information of quit product \n");

printf("4: Total the information of product\n"); }

int menu()

{

printf("1:insert data\n");

printf("2:delete data\n");

printf("3:modify data\n");

printf("4:select data\n");

printf("Other to quit\n");

}

int menu2()

{

printf("0: Quit\n");

printf("1: Enter the information of in product\n ");

printf("2: Enter the information of out product\ n");

printf("3: Enter the information of quit product \n");

printf("4: Total the information of product\n"); }

int insert_product()

{

struct product * p1,* p;

p1=(struct product *)malloc(sizeof(struct produ ct));

p=head;

if (p==NULL)/*开始没有数据*/

{

printf("Enter the data of product\n");

printf("Include the spbh,name,style,num,price,s ale_price of product\n");

scanf("%s%s%s%d%d%d",

&p1->p_num,&p1->name,&p1->spec,&p1->am ount,&p1->price,&p1->s_price);

head=p1;

head->next=NULL;

return 0;

}

while(p->next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/

p=p->next;

p->next=p1;

相关文档
最新文档