没有合适的资源?快使用搜索试试~ 我知道了~
c++综合实验-儿童商品仓库管理系统报告.docx
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 72 浏览量
2022-11-07
14:37:07
上传
评论
收藏 822KB DOCX 举报
温馨提示
试读
21页
...
资源推荐
资源详情
资源评论
西 南 交 通 大 学
课程设计
年
级:
号:
名:
学
姓
专
业:
指 导 老 师:
二零一三年六月
一。课程设计要求(简要描述课程设计的要求)
实现一个简单的儿童商品仓库管理系统。系统的主要功能是登记仓库中各个儿童用品的信息情
况,对部分信息进行检查和处理,并将结果保存。假设仓库中有 3 种不同类型的商品:食品、鞋子、
玩具。
对于食品,要求检查是否过期,并作相应处理;对于鞋子,要求检查是否是过季产品,如果是,就要
做相应处理。
二。模块划分(说明函数和类的定义)
查看信息模块;
添加货物模块;
取出货物模块;
修改信息模块;
三。源程序(程序代码,附部分注释)
#include ”stdafx。h"
#include ”time。h”
#include <iostream〉
using namespace std;
struct times
{
int year,month,day;
};
class childgoods
{
public:
virtual void inputinformation()=0;
virtual void add()=0;
void totalnumber();
public:
char name[20];
double number;
float bid;//进价;
int stock;//库存;
times storage_time;//入库时间;
int inputnumber;
};
class food :public childgoods
{
public:
food(){next=NULL;}
void inputinformation();
void changeinformation(food **f);
void add(){};
void show(food *f);
void showall();
friend void addfood(food **f);
friend void getfood(food **f);
public:
times shelf_life;//保质期;
food *next;
void food::show(food *f)
{
int num;
food *temp;
cout〈<"请输入所要查看货物的编号.”〈〈endl;
cin〉〉num;
temp=f;
if(temp—〉number==num)
temp—〉showall();
else
{
while(temp!=NULL)
{
if(temp->number==num)
break;
temp=temp->next;
}
temp-〉showall();
}
}
void food::showall()
{
cout〈<"名称 编号 进价 库存 入库时间:年 月 日 保质期:年
月 日"〈<endl;
cout<<name<<” ”
<〈number〈〈" ”
〈<bid〈<" ”
〈<storage_time。year〈〈" ”
〈<storage_time。month<<” "
<<storage_time.day<<" ”
〈<shelf_life。year〈<” ”
<〈shelf_life。month<〈” "
〈<shelf_life。day〈〈endl;
nowtime = time(NULL);
double safetime;
safetime=((storage_time.year+shelf_life.year—1970)*31536000+
(storage_time.month+shelf_life。month)*2592000+(storage_time.day+shelf_life。day)*
if(safetime>nowtime)
cout<〈”本食品尚未过期."〈〈endl;
else
cout<〈”本食品已过期,请尽快处理!”<〈endl;
}
void food::inputinformation()
{
cout〈<"名称:”〈〈endl;
cin>>name;
cout<〈”编号:”〈<endl;
cin〉>number;
cout<〈”进价:”<〈endl;
cin>>bid;
cout〈〈”入库数量:”<<endl;
cin〉>inputnumber;
cout<〈"入库时间:”〈〈endl〈〈”年:”;
cin>〉storage_time。year;
cout〈〈”月:";
cin〉〉storage_time.month;
cout〈〈”日:”;
cin>〉storage_time。day;
cout〈〈”保质期:"〈〈endl〈〈"年:”;
cin〉>shelf_life。year;
cout〈〈”月:”;
cin〉〉shelf_life。month;
cout〈<"日:";
cin>>shelf_life。day;
stock=inputnumber;
}
void food::changeinformation(food **f)
{
int option,changenum;
剩余20页未读,继续阅读
资源评论
春哥111
- 粉丝: 1w+
- 资源: 5万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功