商店进存销管理系统C++

这是一个C++编写的商店进存销管理系统,包括重量类、衬衣类、帽子类和柜子类的商品管理。系统支持商品的增删查改,如进货、出货、查看库存等操作。通过类结构管理不同类型的货物,如货物类、衬衣类、帽子类和柜子类,每个类都有相应的属性和方法来维护商品信息。
摘要由CSDN通过智能技术生成

定义的外部变量:

#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
int n=0;
int chemise_n=0;
int cabinet_n=0;
int hat_n=0;

定义的货物头文件:

#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
extern int n;
extern int chemise_n;
extern int cabinet_n;
extern int hat_n;
class Goods
{
public:
 char gn[40];
 char gi[40];
 char* goodsname;
 char* goodsId;
 float buyin;//当前进货
 float sellout;//当前出货
 float weight;//当前总库存
 float totalbuyin;//总进货
 float totalsellout;//总出货

public:
 Goods()
 { 
  buyin=0;
  weight=0;
  sellout=0;
  totalbuyin=0;
  totalsellout=0;
 }
 /*Goods(char* gn,char* gi,float gw=0,float b=0,float s=0)
 {
  strcpy(goodsname,gn);
  strcpy(goodsId,gi);
  weight=gw;
  buyin=b;
  sellout=s;
 }*/
 void setgn();
 void buy();
 void sell();
 float total(); //显示当前货物的库存
 void show();
protected:
 
};
void Goods::setgn()

 cout<<"请输入货物名:";
 cin>>gn;
 cout<<"请输入货物条形码:";
 cin>>gi;
 cout<<"请输入货物重量:";
 cin>>buyin;
 /*cout<<strlen(gn)+1<<endl;*/
 /*cout<<goodsname<<endl;
 cout<<goodsId<<endl;
 cout<<&goodsname<<endl;
 cout<<&goodsId<<endl;
 show();*/
 weight=buyin;
 totalbuyin=buyin;
}
void Goods::buy()
{
 float b;
 cout<<"请输入卖入货物的重量 :";
 cin>>b;
 totalbuyin=totalbuyin+b;
 weight=weight+b;
 cout<<"此次进货"<<b<<"千克"<<endl;
 cout<<"到目前为止,总进货量为:"<<totalbuyin<<"千克"<<endl;
}
void Goods::sell()
{
 float s;
 cout<<"请输入卖出货物的重量 :";
 cin>>s;
 totalsellout=totalsellout+s;
 weight=weight-s;
 cout<<"此次卖出货物"<<s<<"千克"<<endl;
 cout<<"到目前为止,总销货量为:"<<totalsellout<<"千克"<<endl;
}
float Goods::total()
{
 
 return weight;
}
void Goods::show()
{
 cout<<goodsId<<"  "<<goodsname<<"  "<<weight<<" 千克"<<endl;
}

class chemise
{
public:
 char gn[40];
 char gi[40];
 float price ;
 char product_area[50];
 char materiel[20];
 char* goodsname;
 char* goodsId;
 int buyin;//当前进货
 int sellout;//当前出货
 int amount;
 int totalbuyin;//总进货
 int totalsellout;//总出货
 chemise()
 { 
  price=0;
  buyin=0;
  amount=0;
  sellout=0;
  totalbuyin=0;
  totalsellout=0;
 }
 void setgn();
 void set_materiel();
 void buy();
 void sell();
 float total(); //显示当前货物的库存
 void show();
};
void chemise::setgn()

 cout<<"请输入货物名:";
 cin>>gn;
 cout<<"请输入货物条形码:";
 cin>>gi;
 cout<<"请输入单价:";
 cin>>price;
 cout<<"请输入产地:";
 cin>>product_area; 
 cou

  • 2
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值