




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、C+编写仓库管理系统/functions.h#include #include #include #include #include #include using namespace std; void denglu(); void choice(); void zhuce();char first_face();void in_storage();void select_time();void out_storage();void select_ele();void select_name();void select_kind();void select_all();void call();
2、void denglu()string username1,passport1,name1; string username,passport;ifstream storeFile(userdate.txt);if(!storeFile)coutnnt 对不起,用户文件丢失。 。 nnt; system(pause);return;cout 用户登录: endl; coutusername;coutpassport; bool flag=false;while(storeFileusername1passport1name1) if(username1=username&passport1=p
3、assport) flag=true;system(cls); cout 登录成功! endl;cout欢迎您,name1A_Aendl; system(pause);else if(username1=username|passport1=passport)cout 用户名或密码错误! endl; denglu(); store(); call(); choice();void choice()char a;a=first_face(); while(1) switch(a)case 1:in_storage();break;case 2:out_storage();break;case 3
4、:select_ele();break;case 4:system(cls);coutt 谢谢您的使用 !nntt; exit(0);break; default:break;char first_face()system(cls);/ 系统清屏cout=endl;cout*endl;cout*仓库管理系统*endl;cout*endl;cout*1.商品入库*endl;cout*endl;cout*2.商品出库*endl;cout*endl;cout*3.商品查询*endl;cout*endl;cout*4.退出系统*endl;*endl;=endl;cout* cout= return g
5、etch();/ 入库void in_storage()system(cls);/ 系统清屏 string name;/ 商品名 double price;/ 价格 string storeNo;/ 仓库编号 string kinds;/ 商品大类 string shelfNo;/ 货架号 long count=0;/ 商品数量 string time;/ 入库时间coutn;cout商品入库,请输入相关信息:coutendlname;coutendlprice;coutendlcount;coutendlstoreNo;coutendlkinds;coutendlshelfNo;couten
6、dltime;商品名称: ;商品价格: ;商品数量: ;仓库编号: ;商品大类: ;货架编号: ;入库时间(例如:2014.01.01 ): ofstream storeFile(store.txt, ios:app);storeFilesetiosflags(ios:left)setw(20)name setw(15)price setw(10)count setw(10) storeNo setw(20)kinds shelfNosetw(20)timeendl;store();coutnnt 该商品已经入库nnt;cout是否继续?1是2否a;if(a=1)in_storage();if
7、(a=2)first_face();choice();system(pause);/ 系统暂停/ 出库void out_storage()system(cls);/ 系统清屏string name;/ 商品名coutendlt 商品出库,输入出库商品信息: endl;coutname;ifstream storeFile(store.txt);if(!storeFile)ofstream storeFile1(store.txt);store();coutnnt 库存为空nnt;cout是否继续? 1是 2否a;if(a=1)in_storage();else if(a=2)first_fac
8、e();choice();bool flag=false;string name1;/ 商品名double price1;/ 价格string storeNo1;/ 仓库编号string kinds1;/ 商品大类string shelfNo1;/ 货架号long count1=0;/ 商品数量ofstream tempFile(temp.txt);while(storeFilename1price1count1storeNo1kinds1shelfNo1) if(name1=name)flag=true;elsetempFilesetiosflags(ios:left)setw(20)nam
9、e1 setw(15)price1 setw(10)count1 setw(10)storeNo1 setw(20)kinds1 shelfNo1endl;temp();store();if(!flag)coutnnt 仓库中没有该商品! nnt; system(pause);return;ofstream storeFile1(store.txt);ifstream tempFile1(temp.txt);storeFile1temp();store();temp();coutnt 这些商品已经出库,请仔细检查!cout是否继续? 1是2否a;if(a=1)out_storage();if(
10、a=2)first_face();choice();system(pause);/ 查询void select_ele()while (1)system(cls);coutnendl;coutt=tendlt 商 品 查 询 endltendlt1.按商品名称查询endltendlt2.按入库时间查询endltendlt3.查看所有商品endltendl!nnt;endlt4.按商品大类查询endltendlt5. 返回 endltendl t=endl;coutntt;char select=getch(); switch(select)case 1:select_name();break;
11、case 2:select_time();break;case 3:select_all();break;case 4:select_kind();break;case 5:first_face();choice();break; default:break;/ 按商品名称查询void select_name()system(cls); coutendlt 按商品名查询: endl; coutname;string name1;/ 商品名string time1; double price1;/ 价格 string storeNo1;/ 仓库编号 string kinds1;/ 商品大类 st
12、ring shelfNo1;/ 货架号 long count1=0;/ 商品数量 ifstream storeFile(store.txt);if(!storeFile)coutnnt对不起,你的库存为空nnt;system(pause);return;bool flag=false; coutn 商品名 价格 商品数量 仓库编号 商品大类 货架号 入库时间 name1price1count1storeNo1kinds1shelfNo1time1) if(name1=name)flag=true; coutsetiosflags(ios:left) name1 price1 count1 st
13、oreNo1 kinds1 shelfNo1 time1endl;store();if(!flag)coutnn对不起,库存中没有这个商品”;coutnendl;system(pause);void select_time()/ 按入库时间查询system(cls);coutnt 按入库时间查询: endl ;couttime;string name1;/ 商品名double price1;/ 价格string storeNo1;/ 仓库编号string kinds1;/ 商品大类string shelfNo1;/ 货架号string time1;long count1=0;/ 商品数量ifs
14、tream storeFile(store.txt);if(!storeFile)coutnnt对不起,你的库存为空nnt;system(pause);return;bool flag=false;coutn 商品名 setw(15)价格setw(10)商品数量 setw(10)仓库编 号setw(10)商品大类 setw(15)货架号 nname1price1count1storeNo1kinds1shelfNo1time1)if (time1=time)flag=true;coutsetiosflags(ios:left)setw(15)name1 setw(10)price1 setw(
15、10)count1 setw(10)storeNo1 setw(15)kinds1 shelfNo1endl;store();if(!flag)coutnn 对不起,仓库中没有这类商品! ;coutnendl;system(pause);void select_all()/ 查看所有商品system(cls);string name1;/ 商品名string time1;/ 入库时间double price1;/ 价格string storeNo1;/ 仓库编号string kinds1;/ 商品大类string shelfNo1;/ 货架号long count1=0;/ 商品数量ifstre
16、am storeFile(store.txt);if(!storeFile)coutnnt对不起,你的库存为空nnt;system(pause);return;bool flag=false;coutn 商品名 价格 商品数量 仓库编号 商品大类 货架号 入库时间 name1price1count1storeNo1kinds1shelfNo1time1) flag=true;coutsetiosflags(ios:left) name1 price1 count1 storeNo1 kinds1 shelfNo1 time1endl;store();system(pause);/ 按大类查询v
17、oid select_kind()system(cls);coutnt 按商品大类查询: endl ;coutkinds;string name1;/ 商品名double price1;/ 价格string storeNo1;/ 仓库编号string kinds1;/ 商品大类string shelfNo1;/ 货架号string time1;/ 入库时间long count1=0;/ 商品数量ifstream storeFile(store.txt);if(!storeFile)coutnnt对不起,你的库存为空nnt;system(pause);return;bool flag=false
18、;coutn 商品名 价格 商品数量 仓库编号 商品大类 货架号 入库时间 name1price1count1storeNo1kinds1shelfNo1time1) if (kinds1=kinds)flag=true;coutsetiosflags(ios:left)setw(15)name1 setw(10)price1 setw(10)count1 setw(10)storeNo1 setw(15)kinds1 shelfNo1 setw(15)time1endl;store();if(!flag)coutnn对不起,库存中没有这类商品;coutnendl;system(pause);
19、void zhuce()system(cls);/ 系统清屏string username,passport,passport1,name,miyao,jiami;coutusername;coutpassport;coutpassport1;if(passport=passport1)coutname;else if(passport!=passport1)cout 两次输入的密码不一致,请重新输入!endl;while(passport!=passport1)coutpassport;coutpassport1;coutname;ofstream storeFile(userdate.txt, ios:app); storeFilesetiosflags(ios:left)setw(15)username setw(15)passport setw(10)nameendl;store();system(cls);cout 账户创建成功!欢迎您, nameendl;system(pause);system(cls);first_face();choice();void call()/ 提醒功能system(cls);ifstream storeFile(store.
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 考前冲刺注册土木工程师考试试题及答案
- 清华标准测试题及答案
- 护理类单招试题及答案
- 2025南航招聘面试英语题及答案
- 2025护士入职笔试题目及答案
- 新能源汽车核心技术测试试题及答案
- 小学教师教育教学反思与专业发展试题及答案
- 智能矿山无人化作业2025:关键技术突破与应用案例剖析
- 幼儿园数学经验反馈考试试题及答案
- 量子通信技术在工业互联网平台的工业生产数据采集预研报告
- 2025-2030海上风电产业行业市场现状供需分析及投资评估规划分析研究报告
- 玉器代销合同协议书范本
- 正比例函数性质课件
- T-CACM 1212-2019 中医妇科临床诊疗指南 产后小便不通
- 化学(三)-2024年中考考前20天终极冲刺攻略(原卷版)
- 高热的中医护理
- 影音室安装协议合同
- 部门工作目标管理制度
- 【大单元教学】第三单元《幸福一家人》单元整体设计(含教学评价)
- 2025-2030中国玻璃纤维混凝土行业市场发展趋势与前景展望战略研究报告
- 农产品跨境贸易合作协议方案书
评论
0/150
提交评论