2023年-c++ 仓库管理系统.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《2023年-c++ 仓库管理系统.docx》由会员分享,可在线阅读,更多相关《2023年-c++ 仓库管理系统.docx(10页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、#include#includeusing namespace std;const int m=100; 定义常量 m class Store 定义类(private:int num; 编号char name 20; 名 称 double price; /价格 int quantity; 数量 int amount; 数目public:void Input();int Input_2();void Dig();void Change();void Search_num();void Search_name();void Show();void Short();void Delete();goo
2、dslm;void Store:Input() 创建表单 (int i,n;cout ”请输入货物总数:;cinamount;coutendl;for(i=0;iamount;i+) (coutv这是第(i+l) 货物信息” vendl; goodsi.num=i+l;coutvv”货品名:;cingoodsi.name; cout单价:; cingoodsi.price; cout ”库存量:; cingoodsi.quantity; coutendl;while(l);return 0;coutMn 输入的信息:endl;for(i=0;iamount;i+)(coutn货 号:ngood
3、si.numends;coutn货品 名:ngoodsi.nameends;cout单价:goodsi.priceends;cout 库存量:“goodsi.quantityvendsvendl;ofstream os(ngoods.txtH,ios_base:out|ios_base:binary); 仓ll建、打开文件 for(n=0;namount;n+)os.write( reinterpret_cast(&(goodsn),sizeof(Store); 导出文件 os.close(); 关闭文件) int Store:Input_2() 文件读入 (int i,n;ifstream
4、is(ngoods.txtn,ios_base:in|ios_base:binary); if(!is) coutv打开失败 endl;return 0;)for(i=0;is.read( reinterpret_cast(goods+i), sizeof(Store) );i+) amount=i;coutn导入的表单: vvendl;for(n=0;namount;n+) (coutn货 号:Hgoods n .numends;cout”货品:ngoodsn.nameends;cout单价:goodsn.pricevends;cout库存量:goods|n.quantityendsvend
5、l; ) return 1;) void Store:Dig() 插入信息int i,n,m;cout”请输入增加的货物总数:“;cinn;coutendl;for(i=0;in;i+)(cout 这是第 (i+l)vv”货物信息” endl;goods amount+i .num=amount+i4-1;cout”货品名:“;cingoodsamount+i .name;cout“单价:;cingoodsamount+i .price;coutvv”库存量:;cingoodsamount+i.quantity;)coutHn 输入的信息”vvendl;for(i=0;iamount+n;i+
6、)(coutv货号:vgoodsi.numends;coutvv” 货品 名:vgoodsi.name vends;cout单价:goodsi.priceends;cout ”库存量:“ goodsi.quantityendsendl;)amount=amount+n;ofstream os(goods.txt,ios_base:out|ios_base:binary); 创建、打开文件 for(m=0;mamount;m+)(os.write( reinterpret_cast(&(goodsm),sizeof(Store); 导出文件os.close(); 关闭文件);void Store
7、:Change() 修改信息(int n,i,m;cout要修改第几个货物的信息(输入货号):”;cinn;coutendl;cout ”请输入修改的信息” vendl;coutvv”货品名:;cingoodsn-l .name;cout 单价:;cingoodsn-1 .price;coutvv”库存量:;cingoodsn-l .quantity;coutendl;coutvv”修改后的信息:Hendl;for(i=0;iamount;i+)(coutv货号:vvgoodsi .numends;coutn货 品名:ngoodsi.nameends;cout“单彳介:goodsi.price
8、ends;cout“库存量:“goodsi.quantityvendsvendl;ofstream os(ngoods.txtH,ios_base:out|ios_base:binary); 仓ll建、 打开文件 for(m=0;mamount;m+)os.write( reinterpret_cast(&(goodsm),sizeof(Store); 导出文件)os.close(); 关闭文件) void Store:Search_num() 按编号查 int n;coutvv”请输入货号:;do (cinn;coutendl; if(n=amount) (coutn货号:ngoods |n
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2023年-c+ 仓库管理系统 2023 c+ 仓库 管理 系统
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内