C语言版商品库存管理系统方案

上传人:公**** 文档编号:468723225 上传时间:2022-10-15 格式:DOC 页数:17 大小:134.50KB
返回 下载 相关 举报
C语言版商品库存管理系统方案_第1页
第1页 / 共17页
C语言版商品库存管理系统方案_第2页
第2页 / 共17页
C语言版商品库存管理系统方案_第3页
第3页 / 共17页
C语言版商品库存管理系统方案_第4页
第4页 / 共17页
C语言版商品库存管理系统方案_第5页
第5页 / 共17页
点击查看更多>>
资源描述

《C语言版商品库存管理系统方案》由会员分享,可在线阅读,更多相关《C语言版商品库存管理系统方案(17页珍藏版)》请在金锄头文库上搜索。

1、商品信息显示主菜单创建链表输入商品信息添加商品信息输出商品信息查询商品信息按编号查询 按名称查询 修改商品信息 删除商品信息 保存商品信息到文件读取文件内商品信息 退出程序建议使用VS打开运行#pragma once #include typedef struct information /char number20; / 编号 char sname20; /名称float price; /价格int count; / 数量 char dath20; /生产日期struct information *next;inf;void menu(inf *head); / inf *create();

2、/void Input(inf *head);/void tianjia(inf *head); / void output(inf *head);/void chaxun(inf *head);/void chaxun_number(inf *head);/void chaxun_sname(inf *head);/void xiugai(inf *head);/void shanchu(inf *head);/void write_file(inf *head);/void paixu(inf *head);inf *Read_file();/void freeh(inf *head);

3、/#define _CRT_SECURE_NO_WARNINGS#include #include #include #include #include #include #pragma comment(lib, WINMM.lib)#include 标头 .hvoid menu(inf *head) /背景.wav), NULL,显示菜单SND_FILENAME | SND_ASYNC | SND_LOOP); system(color 3B);printf(tt*n);printf(tttt 欢迎进入商品库存管理系统 n);printf(tt*n);printf(tt|_ 基本信息 |n)

4、;printf(tt|1.商品信息录入| 2.添加商品信息|n);printf(tt|3.查找商品信息| 4.修改商品信息|n);printf(tt|5.删除商品信息| 6.保存文件信息|n);printf(tt|7.读取文件信息| 8.显示商品信息|n);printf(tt|9.按价格从高到低进行排序|n);printf(tt|_0.释放链表。退出|);printf(nttt请输入你的选项(0-8 ) :n);printf(n);printf(t请输入你的选择 : n);*create()/创建链表printf(n);printf(tt|=|n); inf *p;p = (inf *)mal

5、loc(sizeof(struct information);if (p = NULL)printf(链表创建失败 .n);exit(0);p-next = NULL; return (p);void Input(inf *head)/inf *p;int i,n;录入货物信息printf( 请输入:你想录入多少个商品信息 : n ); scanf(%d, &n);for (i = 1; i number); printf(名称 :);scanf(%s, p-sname); printf(价格 :);scanf(%f, &p-price); printf(数量 :);scanf(%d, &p-

6、count); printf(生产日期: );scanf(%s,p-dath);p-next = NULL; while (head-next != NULL) head = head-next;head-next = p; void tianjia( inf *head) / 添加货物信息 inf *p;int i,n;printf( 请输入:你想添加多少个商品信息 : n); scanf(%d, &n);for (i = 1; i number); printf(名称 :);scanf(%s, p-sname); printf(价格 :);scanf(%f, &p-price); prin

7、tf(数量 :);scanf(%d, &p-count); printf(生产日期: );scanf(%s,p-dath); p-next = NULL;while (head-next != NULL) head = head-next;head-next = p;void output(inf *head) / 输出货物信息int n = 0;inf *p;p = head-next;if (p = NULL)printf( 链表为空,请先输入信息! n); return;while (p != NULL)n+;%sn,printf(”商品信息:编号:s,名称:s,价格:.2f数量:d生产

8、日期:p-number, p-sname, p-price, p-count,p-dath);p = p-next;printf( 商品总数为: %d n, n);int a;printf(tt 查询信息 n);if (a = 1)chaxun_number(head);/break;if (a = 2)chaxun_sname(head);/break;if (a != 1 & a != 2)printf( 输入错误!break;调用按编号查询的函数调用按名称查询的函数n);while (1)printf(t 1. printf(t 2. printf(按编号查询 n); 按名称查询 n);

9、 请输入你的选择: n);scanf(%d, &a); getchar();/按编号查询void chaxun_number(inf *head)char num20;inf *p;int i = -1;p = head;printf( 请输入你要查询的商品的编号: );scanf(%s, num);while (p-next != NULL) p = p-next;if (strcmp(p-number, num) = 0)i = 1;printf( 已找到该商品信息 n);printf(货物信息:编号:s,名称:s,价格:.2f.数量:d,生产日期: %sn, p-number, p-sn

10、ame, p-price, p-count,p-dath);if (inext != NULL)p = p-next;if (strcmp(p-sname, a) = 0)i = 1;printf(已找到该商品信息 n);printf(商品信息:编号:s,名称:%s,价格:.2f.数量:%d,生产日期n,p-number, p-sname, p-price, p-count,p-dath); if (i0)printf(没有此商品! n);修改货物信息void xiugai(inf *head) / printf(t*n);printf(t请输入修改的方式:n);printf(t1.单个信息全部修改。n);printf(t2.单个信息逐个修改。n);printf(t*n);int a;printf( 请输入选项: n); scanf(%d, &a);if (a = 1)char no20;int i = -1;inf *p; p = head; printf( 请输入要修改商品的编号: n); scanf(%s, no); while (p-

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 办公文档 > 活动策划

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号