课程设计报告2.docx
- 文档编号:18613083
- 上传时间:2023-08-20
- 格式:DOCX
- 页数:23
- 大小:44.43KB
课程设计报告2.docx
《课程设计报告2.docx》由会员分享,可在线阅读,更多相关《课程设计报告2.docx(23页珍藏版)》请在冰点文库上搜索。
课程设计报告2
课程设计报告
课程设计题目:
商场管理
学生姓名雷哲为
学号************
班级1121808
指导教师
2012年06月日
东华理工大学
一.问题分析
1.课题内容
某商场有如下的几种货品:
衬衣、鞋子、帽子、裤子、冰箱、电视、立柜、壁橱、沙发。
每一种货物都有详细的说明信息。
衬衣:
布料、尺寸、单价、产地、库存量、所属货柜;
鞋子:
皮料、尺寸、单价、产地、库存量、所属货柜;
帽子:
布料、样式(平顶或尖顶)、尺寸、单价、产地、库存量、所属货柜;
裤子:
布料、尺寸、单价、产地、库存量、所属货柜;
冰箱:
制冷类型、样式(二门或三门)、颜色、尺寸、单价、产地、库存量、重量、所属货柜;
电视:
样式(彩色或黑白)、颜色、尺寸、单价、产地、库存量、重量、所属货柜;
立柜:
木料、颜色、尺寸、单价、产地、库存量、所属货柜;
壁橱:
木料、颜色、尺寸、单价、产地、库存量、所属货柜;
沙发:
木料、皮料、颜色、尺寸、单价、产地、库存量、所属货柜;
对这些商品的操作有:
新商品的录入,商品的进库,商品的出库,商品的调价,所属货柜的管理,库存的统计,总价格的计算,产地的统计。
要求自行设计数据结构,用类结构将上述的货品表示出来。
在上一步的基础上,将上述的商品管理计算机化,完成操作要求的功能。
2.系统主要功能
1商品入库②商品出库③商品查询④商品调价⑤退出系统
二.结构分析(UML的类图)
三.实现流程分析(类创建流程)
主要基类:
衬衣类:
classchenyi
鞋子类(公有继承衬衣类):
classxiezi:
publicchenyi
帽子类(公有继承衬衣类):
classmaozi:
publicchenyi
裤子类(公有继承衬衣类):
classkuzi:
publicchenyi{};
冰箱类(公有继承帽子类):
classbingxiang:
publicmaozi
电视类(公有继承冰箱类):
classdianshi:
publicbingxiang{};
立柜类(公有继承衬衣类)classligui:
publicchenyi
壁橱类(公有继承立柜类):
classbichu:
publicligui{};
沙发类(公有继承壁橱类):
classshafa:
publicbichu
管理类classadmin
功能类(classshelf,classele,classmana
功能实现函数:
mana();
charfirst_face();//首页
voidin_storage();//入库
voidout_storage();//出库
voidselect_ele();//查询
voidselect_name();//按商品名称查询
voidselect_price();//按商品价格查询
voidselect_kind();//按类别查询
voidcall_break();//商品调价
通过编写这几个函数实现主要功能,最后在主函数中调用这些功能函数即可。
四.个性功能介绍
1.在实现商品查询的时候,以实际应用为导向,分为按商品名称查询、按商品价格查和按商品类别查询,实现了多选择查询,在增强了程序可读性的同时也给实际管理者提供了方便。
2.在实现类的继承的时候,应用公有继承方式并适当派生以实现功能多样化,更加符合使用者的实际需要。
五.程序代码
#include
#include
#include
#include
#include
#include
#include
usingnamespacestd;
classchenyi{
public:
chenyi();
private:
stringbuliao;
intchicun;
doubleprice;
doublekucunliang;
doublehuogui;
};
classxiezi:
publicchenyi{
public:
xiezi();
private:
stringpiliao;
};
classmaozi:
publicchenyi{
public:
maozi();
private:
charstyle;
};
classkuzi:
publicchenyi{};
classbingxiang:
publicmaozi{
public:
bingxiang();
private:
stringcolour;
stringzhilengleixing;
doubleweight;
};
classdianshi:
publicbingxiang{};
classligui:
publicchenyi{
public:
ligui();
private:
stringmuliao;
stringcolour;
};
classbichu:
publicligui{};
classshafa:
publicbichu
{public:
shafa();
private:
stringpiliao;
};
classadmin
{
public:
admin();
private:
stringname;
};
classshelf
{
public:
shelf();
private:
adminmen;//管理员
stringstoreNo;//仓库编号
stringkinds;//商品类别
stringshelfNo;//所属货柜号
};
classele
{
public:
ele();
private:
stringname;//商品名
doubleprice;//价格
shelfsh;//所属货架
longcount;//商品数量
};
classmana
{
public:
mana();
charfirst_face();//首页
voidin_storage();//入库
voidout_storage();//出库
voidselect_ele();//查询
voidselect_name();//按商品名称查询
voidselect_price();//按商品价格查询
voidselect_kind();//按类别查询
voidcall_break();//商品调价
private:
eleaele;
shelfashelf;
adminabs;
};
//默认构造函数
ele:
:
ele():
sh()
{
name="xxx";//商品名
price=0.0;//价格
count=0;//商品数量
}
shelf:
:
shelf():
men()//
{
storeNo="xxx";//仓库编号
kinds="xxx";//商品类别
shelfNo="xxx";;//货架号
}
admin:
:
admin()
{
name="xxx";
}
//管理类默认构造函数
mana:
:
mana():
aele(),ashelf(),abs()
{
}
charmana:
:
first_face()
{
system("cls");
cout< cout< < < < < < < < < < < < < < < returngetch(); } //入库 voidmana: : in_storage() { system("cls"); stringname;//商品名 doubleprice; stringstoreNo;//仓库编号 stringkinds;//商品类别 stringshelfNo;//货架号 longcount=0;//商品数量 cout< "< cout<<"\t商品名称: "; cin>>name; cout< "; cin>>price; cout< "; cin>>count; cout< "; cin>>storeNo; cout< "; cin>>kinds; cout< "; cin>>shelfNo; ofstreamstoreFile("store.txt",ios: : app); storeFile< : left)< < < < storeFile.close(); cout< system("pause"); } //出库 voidmana: : out_storage() { system("cls"); stringname;//商品名 cout< "< cout<<"\t商品名称: "; cin>>name; ifstreamstoreFile("store.txt"); if(! storeFile) { ofstreamstoreFile1("store.txt");// storeFile1.close(); cout< system("pause"); return; } boolflag=false; stringname1;//商品名 doubleprice1;//价格 stringstoreNo1;//仓库编号 stringkinds1;//商品类别 stringshelfNo1;//所属货柜号 longcount1=0;//商品数量 ofstreamtempFile("temp.txt"); while(storeFile>>name1>>price1>>count1>>storeNo1>>kinds1>>shelfNo1) { if(name1==name) flag=true; else { tempFile< : left)< < < < } } tempFile.close(); storeFile.close(); if(! flag) { cout< system("pause"); return; } ofstreamstoreFile1("store.txt"); ifstreamtempFile1("temp.txt"); storeFile1< storeFile1.close(); tempFile1.close(); cout< system("pause"); } //查询 voidmana: : select_ele() { while (1) { system("cls"); cout< cout<<"\t============================================================="< <<"\t||||"< <<"\t||商品查询||"< <<"\t||||"< <<"\t||1.按商品名称查询||"< <<"\t||||"< <<"\t||2.按商品价格查询||"< <<"\t||||"< <<"\t||3.按商品类别查询||"< <<"\t||||"< <<"\t||4.返回||"< <<"\t||||"< <<"\t============================================================="< charselect=getch(); switch(select) { case'1': select_name(); break; case'2': select_price(); break; case'3': select_kind(); break; case'4': return; default: break; } } } //按商品名称查询 voidmana: : select_name() { system("cls"); cout< "< cout<<"\t输入商品名: "; stringname; cin>>name; // stringname1;//商品名 doubleprice1;//价格 stringstoreNo1;//仓库编号 stringkinds1;//商品类别 stringshelfNo1;//货架号 longcount1=0;//商品数量 ifstreamstoreFile("store.txt"); if(! storeFile) { cout< system("pause"); return; } boolflag=false; cout< while(storeFile>>name1>>price1>>count1>>storeNo1>>kinds1>>shelfNo1) { if(name1==name) { flag=true; cout< : left)< < < < } } storeFile.close(); if(! flag) cout< cout< system("pause"); } //按商品价格查询 voidmana: : select_price() { system("cls"); cout< "< cout<<"\t输入价格: "; doubleprice;// cin>>price; stringname1;//商品名 doubleprice1;//介格 stringstoreNo1;//仓库编号 stringkinds1;//商品类别 stringshelfNo1;//货架号 longcount1=0;//商品数量 ifstreamstoreFile("store.txt"); if(! storeFile) { cout< system("pause"); return; } boolflag=false; cout< while(storeFile>>name1>>price1>>count1>>storeNo1>>kinds1>>shelfNo1) { if(price1==price) { flag=true; cout< : left)< < < < } } storeFile.close(); if(! flag) cout< cout< system("pause"); } //按类别查询 voidmana: : select_kind() { system("cls"); cout< "< cout<<"\t输入类别名: "; stringkinds; cin>>kinds; stringname1;//商品名 doubleprice1;//价格 stringstoreNo1;//仓库编号 stringkinds1;//商品类别 stringshelfNo1;//所属货柜号 longcount1=0;//商品数量 ifstreamstoreFile("store.txt"); if(! storeFile) { cout< system("pause"); return; } boolflag=false; cout< while(storeFile>>name1>>price1>>count1>>storeNo1>>kinds1>>shelfNo1) { if(kinds1==kinds) { flag=true; cout< : left)< < < < } } storeFile.close(); if(! flag) cout< cout< system("pause"); } //商品调价 voidmana: : call_break()
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 课程设计 报告
![提示](https://static.bingdoc.com/images/bang_tan.gif)