C++大作业 商品库存管理系统

 利用c++做的课程设计(链表),在DEV C++等编译器上可通过

运行完毕后可自动保存信息输出文件

觉得还可以的话请点赞收藏哦

#include<iostream>
#include<fstream>
#include<string>
#include<iomanip>
#include<windows.h>
using namespace std;

enum GoodsType//商品类别
{
	Food=1,//食品
    Cosmetic,//化妆品
	Commodity,//日用品
	Drink//饮料
};

struct Date
{
	int year;
	int month;
	int day;
};

struct Goods//商品基本信息
{
	string code;//商品编号
	string name;//商品名称
	string brand;//生产厂家
	double price;//商品价格
	int num;//商品数量
	GoodsType type;//商品类别
	Date date;//入库时间
	Goods *next;
};


class GoodsManage//商品管理
{
public:
	GoodsManage();
	~GoodsManage(){}
	void DisplayMainMenu();//主菜单显示
	void AddGoodsInfo();//添加商品信息
	void DisplayGoodsInfo();//浏览商品信息
	void SearchByCode();//按照商品编号搜索商品信息
	void SearchByName();//按照商品名称搜索商品信息
    void DeleteGoodsInfo();//删除商品信息
	void SellGoodsInfo();//出售商品信息
	void SaveGoodsInfo();//保存商品信息
private:
	int amount;//商品量
	int DeleteAmount;
	Goods *head;
	Goods *DeleteHead;
};

GoodsManage::GoodsManage()//定义构造函数
{
	amount=0;
	DeleteAmount=0;
	head=new Goods;
	head->next=NULL;
	DeleteHead=new Goods;
	DeleteHead->next=NULL;
}

void GoodsManage::DisplayMainMenu()//定义主菜单函数
{
	cout<<" ━═☆┈━═☆┈━═☆┈━═☆┈━═☆┈━═☆┈━═☆┈━═☆━═☆\n";
    cout<<" ┋                                                                ┋\n";
    cout<<" ┋                   欢迎使用商品库存管理系统                     ┋\n";
    cout<<" ┋                                                                ┋\n";
    cout<<" ┋                                                                ┋\n";
    cout<<" ┋                        【商品进货】…(a)                       ┋\n";
    cout<<" ┋                                                                ┋\n";
    cout<<" ┋                        【商品编辑】…(b)                       ┋\n";
	cout<<" ┋                                                                ┋\n";
    cout<<" ┋                        【商品删除】…(c)                       ┋\n";
	cout<<" ┋                                                                ┋\n";
    cout<<" ┋                        【按照编号查询】…(d)                   ┋\n";
	cout<<" ┋                                                                ┋\n";
	cout<<" ┋                        【按照名称查询】…(e)                   ┋\n";
	cout<<" ┋                                                                ┋\n";
    cout<<" ┋                        【商品出货】…(h)                       ┋\n";
    cout<<" ┋                                                                ┋\n";
    cout<<" ┋                        【商品统计】…(i)                       ┋\n";
	cout<<" ┋                                                                ┋\n";
    cout<<" ┋                        【信息保存】…(j)                       ┋\n";
	cout<<" ┋                                                                ┋\n";
    cout<<" ┋                                                                ┋\n";
    cout<<" ┋                          退出系统…(k)                         ┋\n";
    cout<<" ┋                                                                ┋\n";
    cout<<" ━═☆┈━═☆┈━═☆┈━═☆┈━═☆┈━═☆┈━═☆┈━═☆━═☆\n";
    cout<<"\n  
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值