c++编写仓库管理系统

上传人:M****1 文档编号:470288137 上传时间:2023-02-23 格式:DOCX 页数:10 大小:18.29KB
返回 下载 相关 举报
c++编写仓库管理系统_第1页
第1页 / 共10页
c++编写仓库管理系统_第2页
第2页 / 共10页
c++编写仓库管理系统_第3页
第3页 / 共10页
c++编写仓库管理系统_第4页
第4页 / 共10页
c++编写仓库管理系统_第5页
第5页 / 共10页
点击查看更多>>
资源描述

《c++编写仓库管理系统》由会员分享,可在线阅读,更多相关《c++编写仓库管理系统(10页珍藏版)》请在金锄头文库上搜索。

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 usernamel 5passport1 ,name1; string username,passport;ifstream storeFile(Huserdate.txtH);if(lstoreFile)(coutvvnnt 对不起,用户文件丢失。nnt; system(pause); return;coutu 用户登录:endl; coutvv” 请输入用户名:cinusername;coutvv” 请输入密码:cinpassport; bool flag=false;while(storeFileusemame1 passport1 name1)

3、(if(username1 =username&passport1 =passport)(flag=true;system(Hclsn); coutH 登录成功! nendl;coutvv”欢迎您Jvvnamel vv“A_Avvendl; system(pause);else if(username1 =username|passport1 =passport) cout用户名或密码错误! vvendl; denglu(); )storeFile.close();call(); choice();void choice()(char a;a=first_face(); while(1) sw

4、itch(a)case T:in_storage();break;case 2:out_storage();break;case 3:select_ele();break;case 4:system(Hcls);coutt 谢谢您的使用!nntt; exit(O);break; default:break; )char first_face()(systemCls);/ 系统清屏coutH=Hendlcout*nendl;coutn* 仓库管理系统*nendl;coutn*nendl;coutn*1 .商品入库*endl;coutn*nendl;coutM*2.商品出库*endl;coutM*

5、nendl;coutM*3.商品查询*nendl;coutM*nendl;cout*4.退出系统*endl;*Hendl;=Hendl;coutH* coutn= return getch();入库void in_storage()system(HclsH);/ 系统清屏 string name;/ 商品名 double price; 价格 string store No;/ 仓库编号string kinds;/商品大类string shelfNo;/货架号long count=0;/商品数量 string time;/ 入库时间cout,fnn;coutvv”商品入库,请输入相关信息:商品名

6、称:商品价格:商品数量:仓库编号:商品大类:货架编号:coutendlHt cinname;coutendlHt cinprice;coutendlHt cincount;coutendlHt cinstoreNo; coutendlHt cinkinds;coutendlHtcinshelfNo;2014.01.01 ): ”coutendlt入库时间(例如: cintime;ofstream storeFile(f,store.txtH, ios:app); storeFilesetiosflags(ios:left)setw(20)namen H setw(15)priceH Hsetw

7、(10)countM H setw(10) storeNoH Hsetw(20)kinds u shelfNon setw(20)timeendl;storeFile.close();coutMnnt 该商品已经入库. nnt; coutvv”是否继续? 1 是 2否vvendl; int a; cina;if(a=1 )in_storage(); if(a=2) first_face();choice(); )system(Hpause);/ 系统暂停 出库 void out_storage() (systemCcls1);/ 系统清屏 string name;/ 商品名coutendlMt

8、商品出库,输入出库商品信息:vvendl;coutnnt 商品名称:cinname;ifstream storeFile(Mstore.txt);if(lstoreFile)(ofstream storeFilel (Hstore.txtn);storeFile1.close();coutvv”nnt 库存为空nntM;coutvv”是否继续? 1 是 2否vvendl;int a;cina;if(a=1 )in_storage();else if(a=2)first_face();choice();)bool flag=false;string namel;/ 商品名double price

9、l;/ 价格string storeNol;/ 仓库编号string kindsl;/ 商品大类string shelfNol ; 货架号long count1=0;/ 商品数量ofstream tempFile(f,temp.txtn);while(storeFilename1 price1 count1 storeNo1 kinds1 shelfNo1)(if(name1=name)flag=true;else(tempFilesetiosflags(ios:left)setw(20)name1 n Hsetw(15)price1 setw(10)count1 setw(10)storeN

10、o1 setw(20)kinds1 shelfNo1endl;)tempFile.close();storeFile.close();if(!flag)coutnnt 仓库中没有该商品! nnt,; system(pauseH);return;)ofstream storeFilel (Hstore.txtH);ifstream tempFilel (temp.txf);storeFilel tempFile1 .rdbuf();storeFilel .close();tempFilel .close();coutnt这些商品已经出库,请仔细检查!coutvv”是否继续? 1 是2否vve n

11、dl;inta;! nnt;cina;if(a=1 )out_storage();if(a=2)first_face();choice();)system(Mpausen);查询void select_ele()while (1)system(cls);coutHn,endl;coutvvt=,t,endlHt商品查询endl,t,endlvv”t1 .按商品名称查询“vvendl,t,endlvv”t2.按入库时间查询“vvendl ,t,endlvv”t3.查看所有商品Zvendlutendlvv”t4.按商品大类查询“vvendlMt,endlt5.返回 Mendltendl vvt=v

12、vendl; coutMntt;char select=getch(); switch(select) case T:select_name();break;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); coutendl,t 按商品名查询:endl; coutnnt 输入商品名: string

13、name; cinname;string namel;/ 商品名string timel; double pricel;价格 string storeNol;仓库编号 string kinds!;商品大类 string shelfNol;/ 货架号 long count1=0;/ 商品数量 ifstream storeFile(store.txf);if(lstoreFile) (coutnnt对不起,你的库存为空.nntn;system(Hpause,f);return;bool flag=false; coutn商品名“vv“价格“vv”商品数量“vv”仓库编号”vv“商品大类“vv”货架号”vv“入库时间“vvendl;while(storeFilename1 price1 count1 storeNo1 kinds1 shelfNo1 time1) ( if(name1=name) flag=true; coutsetiosflags(ios:left)H Hname1n ,fprice1 count1 storeNo1n

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业/管理/HR > 营销创新

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