|
1楼 设计一个简单的仓储管理系统,要求具有基本的操作功能:插入(添加)、删除、查找、修改和统计。 业务简介 1.采购人员将采购物资清单交与财务人员,其中包含一些必要的数据.财务人员据此作帐,将数据记入,并开一张票据,交与采购人员实现物资入库. 2.当有物资卖出时,即物资出库,财务人员会查阅目前此类货物的库存情况,如此类货物还有存量,且有不同的出价时,财务人员会根据情况,调出相应价的货物. 由于市场行情时常波动,管理人员可能会据此对物资做出相应的调价. 3.当货物出现问题,需要退给供货商,并把退还的货物名,数量,金额,记录下来. 4.到一定时期的时候,例如月底,年终,需要将各种物资的出入库,库存金额整理出来,以便为管理人员提供详尽,可靠的数据,为下一步制定目标方案提供依据. 2、1数据结构 用4个结构数组(或链表)来存储下述4类信息,每类信息的每条记录用结构类型自定义: 1.商品信息:商品编号、商品名、型号/规格、数量、进货价、销售价 2.入库信息:入库编号、商品编号、入库商品名、入库数量、入库价格、总价 3.出库信息:出库编号、商品编号、出库商品名、出库数量、出库价格、总价 4.退货信息:退货编号、商品编号、退还货物名、退货数量、退货价格、总价 2、2 设计要求 5. 对以上每类信息建立数据结构 6. 对以上每类信息进行插入操作 7. 对以上每类信息进行删除操作 8. 对以上每类信息进行修改操作 9. 对以上每类信息进行查找操作(查找关键字用下划线标出) 10. 数据统计; i. 统计入库商品的总数及总价: ii. 统计出库商品的总数及总价: iii. 统计仓库中现有商品的总数及总价格: #include <stdio.h> #include <string.h> 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]; char name[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 num[12]; 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 product)); p=head; if (p==NULL)/*开始没有数据*/ { printf("Enter the data of product\n"); printf("Include the spbh,name,style,num,price,sale_price of product\n"); scanf("%s%s%s%d%d%d", &p1->p_num,&p1->name,&p1->spec,&p1->amount,&p1->price,&p1->s_price); |
|
|
|
|
2楼 head->next=NULL; return 0; } while(p->next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/ p=p->next; p->next=p1; printf("Enter the data\n"); 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_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 product\n"); printf("Include the rkbh,spbh,name,number,price,total_price\n"); 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; return 0; } while(p->next!=NULL)/*把指针移到链表末端,在链表末端插入数据*/ p=p->next; p->next=p1; printf("Enter the data\n"); 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_num[12]; struct in_product * p; p=ihead; printf("Enter the modify num\n"); scanf("%s",&m_num); if (p==NULL)/*开始没有数据*/ { printf("Sorry! No data can be found\n"); return 0; } while(p!=NULL) { if (strcmp(p->num,m_num)==0) { printf("Enter the new data without num\n"); scanf("%s%s%d%d%d", &p->p_num,&p->name,&p->amount,&p->price,&p->t_price); printf("One data had modified\n"); return 0; } p=p->next; } printf("Sorry! No num has found\n"); } int in_select() { char s_num[12]; struct in_product * p; p=ihead; printf("Enter the select num\n"); 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 %d\n", p->num,p->p_num,p->name,p->amount,p->price,p->t_price); return 0; } p=p->next; } printf("Sorry! No num has found\n"); } int in_delete() { char d_num[12]; struct in_product * p1,* p; p=ihead; printf("Enter the delete num\n"); scanf("%s",&d_num); if (p==NULL)/*开始没有数据*/ { printf("No data can be found\n"); return 0; } if (strcmp(p->num,d_num)==0 && p->next==NULL)/*链表只有一个数据,且是要删除的*/ { ihead=NULL; printf("One data has been deleted\n"); return 0; } if (strcmp(p->num,d_num)==0 && p->next!=NULL)/*要删除的数据在链表的头上*/ { ihead=ihead->next; printf("One data has been deleted\n"); 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 deleted\n"); return 0; } p=p->next; } printf("Sorry! No num has found\n"); } 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 product\n"); printf("Include the ckbh,spbh,name,number,price,total_price\n"); 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 data\n"); scanf("%s%s%s%d%d%d", &p1->num,&p1->p_num,&p1->name,&p1->amount,&p1->price,&p1->t_price); |
|
|
|
|
3楼 } int out_modify() { char m_num[12]; struct out_product * p; p=ohead; printf("Enter the modify num\n"); scanf("%s",&m_num); if (p==NULL)/*开始没有数据*/ { printf("Sorry! No data can be found\n"); return 0; } while(p!=NULL) { if (strcmp(p->num,m_num)==0) { printf("Enter the new data without num\n"); scanf("%s%s%d%d%d", &p->p_num,&p->name,&p->amount,&p->price,&p->t_price); printf("One data had modified\n"); return 0; } p=p->next; } printf("Sorry! No num has found\n"); } int out_select() { char s_num[12]; struct out_product * p; p=ohead; printf("Enter the select num\n"); 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 %d\n", p->num,p->p_num,p->name,p->amount,p->price,p->t_price); return 0; } p=p->next; } printf("Sorry! No num has found\n"); } int out_delete() { char d_num[12]; struct out_product * p1,* p; p=ohead; printf("Enter the delete num\n"); scanf("%s",&d_num); if (p==NULL)/*开始没有数据*/ { printf("No data can be found\n"); return 0; } if (strcmp(p->num,d_num)==0 && p->next==NULL)/*链表只有一个数据,且是要删除的*/ { ohead=NULL; printf("One data has been deleted\n"); return 0; } if (strcmp(p->num,d_num)==0 && p->next!=NULL)/*要删除的数据在链表的头上*/ { ohead=ohead->next; printf("One data has been deleted\n"); 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 deleted\n"); return 0; } p=p->next; } printf("Sorry! No num has found\n"); } 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 of quit product\n"); printf("Include the thbh,spbh,name,number,price,total_price\n"); 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 data\n"); 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 quit_modify() { char m_num[12]; struct quit_product * p; p=qhead; printf("Enter the modify num\n"); scanf("%s",&m_num); if (p==NULL)/*开始没有数据*/ { printf("Sorry! No data can be found\n"); return 0; } while(p!=NULL) { if (strcmp(p->num,m_num)==0) { printf("Enter the new data without num\n"); scanf("%s%s%d%d%d", &p->p_num,&p->name,&p->amount,&p->price,&p->t_price); printf("One data had modified\n"); return 0; } p=p->next; } printf("Sorry! No num has found\n"); } int quit_select() { char s_num[12]; struct quit_product * p; p=qhead; printf("Enter the select num\n"); 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 %d\n", p->num,p->p_num,p->name,p->amount,p->price,p->t_price); |
|
|
|
|
4楼 } p=p->next; } printf("Sorry! No num has found\n"); } int quit_delete() { char d_num[12]; struct quit_product * p1,* p; p=qhead; printf("Enter the delete num\n"); scanf("%s",&d_num); if (p==NULL)/*开始没有数据*/ { printf("No data can be found\n"); return 0; } if (strcmp(p->num,d_num)==0 && p->next==NULL)/*链表只有一个数据,且是要删除的*/ { qhead=NULL; printf("One data has been deleted\n"); return 0; } if (strcmp(p->num,d_num)==0 && p->next!=NULL)/*要删除的数据在链表的头上*/ { qhead=qhead->next; printf("One data has been deleted\n"); 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 deleted\n"); return 0; } p=p->next; } printf("Sorry! No num has found\n"); } int total() { int in_num=0,in_price=0; int out_num=0,out_price=0; int num=0,price=0; struct in_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 product's total number and total price is:\n"); printf("%d %d\n",in_num,in_price); printf("The out product's total number and total price is:\n"); printf("%d %d\n",out_num,out_price); printf("The product's total number and total price is:\n"); printf("%d %d\n",num,price); } int in_case() { int choice; printf("The information of in product:\n"); while(1) { printf("Enter the choice\n"); 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) { printf("Enter the choice\n"); 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 choice\n"); scanf("%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(); } } |
|
|
|
| 221.207.13.* |
5楼 |
|
|
| 219.146.66.* |
8楼 |
|
|
| 221.12.10.* |
9楼 我还有一个问题就是如果是一个大的商场,可能有7,8层高,产品种类数以千计的情况下,就有必要对产品分类:按商品的属性等等分类;分区,是对商品的地理位置而言,查找时就能知道在那一层中的哪一个地方,还有就是在节假日时候有打折,优惠啊什么活动时,也就是可扩展性要强,因此还要考虑其他多方面的因素, 顺便说一下,不要小看这个欧,做好了,可以当饭吃. elva有空的话,可以再完善一下,买它个三五百不成问题 |
|
|
| 221.12.10.* |
10楼 |
|
|
| 202.116.24.* |
11楼 |
|
|
| 202.118.72.* |
12楼 |
|
|
| 222.18.58.* |
13楼 |
|
|
| 222.18.58.* |
14楼 雨飞 |
|
|
| 219.138.80.* |
15楼 |
|
|
| 219.140.12.* |
16楼 |
|
|
| 61.132.1.* |
17楼 |
|
|
| 61.132.1.* |
18楼 厉害啊。我的偶像啊 。对了,要是在解释方面再详细点,那就跟好拉啊。请问一下啊,这个高手是那个学校毕业的啊 。 |
|
|
| 58.244.30.* |
21楼 |
|
|
| 61.243.231.* |
22楼 |
|
|
|
23楼 系统的要求是: 销售管理系统: 某公司有四个销售员(编号:1-4),负责销售五种产品(编号:1-5)。每个销售员都将当天出售的每种产品各写一张便条交上来。每张便条包含内容: 1)销售员的代号 2)产品的代号 3)这种产品的当天的销售额 每位销售员每天可能上缴0-5张便条。假设,收集到了上个月的所有便条,编写一个处理系统,读取上个月的销售情况(自己设定),进行如下处理。 1)计算上个月每个人每种产品的销售额。 2)按销售额对销售员进行排序,输出排序结果(销售员代号) 3)统计每种产品的总销售额,对这些产品按从高到底的顺序,输出排序结果(需输出产品的代号和销售额) 4)输出统计报表 销售统计报表 产品代号 销售之和 销售员代号 1 2 3 4 5 1 2 3 4 每种产品之和 总和 [em24][em24][em24][em25][em25][em25][em27][em27][em27] |
|
|
|
| 121.13.232.* |
24楼 |
|
|
|
25楼 #include<string.h> #define N 20 #include<stdio.h> struct xiaoshou {int num; char name[16]; char date[16] ; int money; }xsh[N]; void menu(); void tjyue(); void tjtian(); void show(); main() { int n; while(1) { menu(); printf("\n please inter the number in the menu:"); scanf("%d",&n); switch(n) {case 1: exit(0);break; case 2: show();break; case 3: tjyue();break; case 4: tjtian();break; default: printf("wrong number ,please inter the number in the menu\n "); } } } void menu() {printf(" xiao shou xinxi xitong\n "); printf("\n 1 exit"); printf("\n 2 show the sale system"); printf("\n 3 tongji the sale in july "); printf("\n 4 tongji the sale on someday"); } void show() {struct xiaoshou xsh[N]; FILE *fp; if((fp=fopen("E:\\file28.txt","r"))==NULL) { printf("can't open this file!\n"); return; } else system("type e:\\file28.txt"); getch(); fclose(fp); } void tjyue() {struct xiaoshou xsh[N],temp; int n,sum=0; FILE *fp; int i=0; if((fp=fopen("E:\\file28.txt","r"))==NULL) { printf("can't open this file!\n"); return; } else for(i=0;i<N;i++) fread(&xsh[i],sizeof(struct xiaoshou),1,fp); printf("please enter the name"); scanf("%s",temp.name); for(i=0;i<N;i++) if(strcmp(temp.name,xsh[i].name==0)) sum=sum+xsh[i].money; else { printf("haven't this name.please enter the name in the menu"); return; } printf("the month sale is :%d",sum); fclose(fp); } void tjtian() { struct xiaoshou xsh[N],temp; int sum=0; FILE *fp; int i=0; if((fp=fopen("E:\\file28.txt","r"))==NULL) { printf("can't open this file!\n"); return; } else for(i=0;i<N;i++) fread(&xsh[i],sizeof(struct xiaoshou),1,fp); printf("please enter a date:\n"); scanf("%s",temp.date); for(i=0;i<N;i++) if(strcmp(temp.date,xsh[i].date)==0) sum=sum+xsh[i].money; printf("the sale in this day is:%d\n",sum); fclose(fp); } |
|
|
|
|
26楼 99 |
|
|
|
| 123.114.76.* |
27楼 http://bjbenet.net/edu/win.asp |
|
|
| 59.62.10.* |
28楼 |
|
|
|
29楼 库存商品基本信息管理 实现基本功能: 1) 具备对库存商品基本信息的管理功能(添加、删除、修改) 2) 具备对库存商品基本信息的查询功能(能根据至少三个不同条件查询) |
|
|
|
|
30楼 |
|
|
|
