资源预览内容
第1页 / 共21页
第2页 / 共21页
第3页 / 共21页
第4页 / 共21页
第5页 / 共21页
第6页 / 共21页
第7页 / 共21页
第8页 / 共21页
第9页 / 共21页
第10页 / 共21页
亲,该文档总共21页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
西 南 交 通 大 学课程设计 年 级: 学 号: 姓 名: 专 业: 指 导 老 师: 二零一三年六月一.课程设计要求(简要描述课程设计的要求)实现一个简单的儿童商品仓库管理系统。系统的主要功能是登记仓库中各个儿童用品的信息情况,对部分信息进行检查和处理,并将结果保存。假设仓库中有3种不同类型的商品:食品、鞋子、玩具。对于食品,要求检查是否过期,并作相应处理;对于鞋子,要求检查是否是过季产品,如果是,就要做相应处理。二.模块划分(说明函数和类的定义)查看信息模块;添加货物模块;取出货物模块;修改信息模块; 三.源程序(程序代码,附部分注释)#include stdafx.h#include time.h#include using namespace std;struct timesint year,month,day;class childgoodspublic:virtual void inputinformation()=0;virtual void add()=0;void totalnumber();public:char name20;double number;float bid;/进价;int stock;/库存;times storage_time;/入库时间;int inputnumber;class food :public childgoodspublic: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请输入所要查看货物的编号.num;temp=f;if(temp-number=num)temp-showall();elsewhile(temp!=NULL)if(temp-number=num)break;temp=temp-next;temp-showall();void food:showall()cout名称 编号 进价 库存 入库时间:年 月 日 保质期:年 月 日endl;coutname number bid stock storage_time.year storage_time.month storage_time.day shelf_life.year shelf_life.month shelf_life.daynowtime)cout本食品尚未过期.endl;elsecout本食品已过期,请尽快处理!endl;void food:inputinformation()cout名称:name;cout编号:number;cout进价:bid;cout入库数量:inputnumber;cout入库时间:endlstorage_time.year;coutstorage_time.month;coutstorage_time.day;cout保质期:endlshelf_life.year;coutshelf_life.month;coutshelf_life.day;stock=inputnumber;void food:changeinformation(food *f)int option,changenum;food *temp=*f;cout请输入要修改货品的编号:changenum;while(temp!=NULL)if(temp-number=changenum)break;temp=temp-next;if(temp=NULL)cout仓库内无此货品。endl;elsecout1.名称 2.编号 3.进价 4.库存 option;while(option4|option1)cout输入不合法,请重新输入。endl;cout1.名称 2.编号 3.进价 4.库存 option;switch(option)case 1:cout请输入新名称:temp-name;break;case 2:cout请输入新编号:temp-number;break;case 3:cout请输入新进价:temp-bid;break;case 4:cout请输入新库存:temp-stock;break;default:cout输入不合法,请重新输入。endl;class shoe :public childgoodspublic:void inputinformation();void changeinformation(shoe *s);void add();void show(shoe *s);void showall();void showone();friend void addshoe(shoe *s);friend void getshoe(shoe *s);public:char season20;shoe *now;shoe *next;void shoe:inputinformation()cout名称:name;cout编号:number;cout进价:bid;cout适合季节:season;cout入库数量:inputnumber;cout入库时间:endlstorage_time.year;coutstorage_time.month;cout日:;void shoe:changeinformation(shoe *s)int option,changenum;shoe *temp=*s;cout请输入要修改货品的编号:changenum;while(temp!=NULL)if(temp-number=changenum)break;temp=temp-next;if(temp=NULL)cout仓库内无此货品。endl;elsecout1.名称 2.编号 3.进价 4.库存 option;while(option4|option1)cout输入不合法,请重新输入。endl;cout1.名称 2.编号 3.进价 4.库存 option;switch(option)case 1:cout请输入新名称:temp-name;break;case 2:cout请输入新编号:temp-number;break;case 3:cout请输入新进价:temp-bid;break;case 4:cout请输入新库存:temp-stock;break;default:cout输入不合法,请重新输入。endl;void shoe:showall()cout名称 编号 进价 适合季节 库存 入库时间:年 月 日 endl;coutname number bid season stock storage_time.year storage_time.month storage_time.dayendl;void shoe:show(shoe *s)int num;shoe *temp;cout请输
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号