仓库管理系统C++课程设计报告_第1页
仓库管理系统C++课程设计报告_第2页
仓库管理系统C++课程设计报告_第3页
仓库管理系统C++课程设计报告_第4页
仓库管理系统C++课程设计报告_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、.高级语言程序设计课程设计报告设计题目图书管理系统专业计算机科学与技术班级姓名学号2007 年 6 月 5 日1 / 18.目录1. 目的32. 思想33. 及 象 44. 程序源代 55. 166. 182 / 18.仓库管理系统1设计目的通过实习进一步掌握所学的基本知识,学会解决实际问题的方法2 设计题目1、问题描述(功能要求) :某公司现有以下设备: 普通电视机、 DVD、带 DVD 的电视机,带 DVD的电视机的售价为普通电视机和 DVD单价之和的 80%,要求对所有的库存设备都能按照品名进行显示、查找、增加和删除、保存的功能。2、问题的解决方案:根据系统功能要求,可以将问题解决分为以

2、下步骤:(1)分析系统中的各个实体之间的关系及其属性和行为;(2)根据问题描述,设计系统的类层次;(3)完成类层次中各个类的描述(包括属性和方法);(4)完成类中各个成员函数的定义;(5)完成系统的应用模块;(6)功能调试;(7)完成系统总结报告以及系统使用说明书。2设计思想( 1) 设计 class admin 管理库,实现对仓库信息的描叙; classshelf 柜台类库实现建立电器资料; classele 电器类,实现对电器的描述,电器的编号,货架号,名称,数量,价格等; classmana 函数类,实现对电器的入库,查找,出库等。以下是函数功能表:函数功能char first_face

3、()获取首页void show_storage()显示储存信息void in_storage()电器入库void out_storage()电器出库void select_ele()查询电器信息void select_name()按电器名查询void select_price()按电器价格查询void call_s()商品保存( 2)用类的成员函数对链表的数据进行操作,其功能如上表所列。3 / 18.( 3)设计菜单来实现功能设计1、 输入商品2、 商品查找3、 查询入库4、 商品出库5 、退出系统3设计类及对象(1) 本程序定义了四个类,定义如下:class adminpublic:admi

4、n();private:string name;class shelfpublic:shelf();private:string storeNo;/仓库编号string shelfNo;admin we;/货架号;class elepublic:ele();private:string name;/商品名double price;/介格shelf sh;/ 所属货架long count;/商品数量;class manapublic:mana();char first_face();/首页void show_storage();/显示void in_storage();/入库4 / 18.voi

5、d out_storage();/出库void select_ele();/查询void select_name();/按商品名称查询void select_price();/按商品价格查询void call_s();/商品保存void show_storage1();private:admin abs;ele aele;shelf ashelf;ele:ele():sh()name = xxx;/商品名price = 0.0;/介格count = 0;/商品数量( 2)分别利用类 class admin、 class shelf、class ele、class mana定义了各自的对象 ad

6、min abs 、 shelf sh; ele aele;对其函数进行调用实现各种功能。( 3)主函数实现,调用各种函数。4程序源代码#include #include #include #include #include using namespace std;class adminpublic:admin();private:string name;class shelfpublic:shelf();private:string storeNo;/仓库编号5 / 18.string shelfNo;admin we;/货架号;class elepublic:ele();private:st

7、ring name;/商品名double price;/介格shelf sh;/所属货架long count;/商品数量;class manapublic:mana();char first_face();/首页void show_storage();/显示void in_storage();/入库void out_storage();/出库void select_ele();/查询void select_name();/按商品名称查询void select_price();/按商品价格查询void call_s();/商品保存void show_storage1();private:admi

8、n abs;ele aele;shelf ashelf;ele:ele():sh()name = xxx;/商品名price = 0.0;/介格count = 0;/商品数量shelf:shelf():we()storeNo = xxx;/仓库编号shelfNo = xxx;/货架号6 / 18.admin:admin()name = xxx;mana:mana():aele(), ashelf(), abs()char mana:first_face()system(cls);cout endl;cout endlttendl tt endl tt公司库存货物管理系统 endl tt end

9、l tt 1.输入商品 endl tt endl tt 2.商品查找 endl tt endl tt 3.查询入库 endl tt endl tt 4.商品出库 endl tt endl tt 5.退出系统 endl tt endl ttendl endl tt;return getch();void mana:in_storage()system(cls);string name;/商品名double price;/介格string storeNo;/仓库编号string kinds;/商品大类string shelfNo;/货架号long count = 0; /商品数量cout endl

10、 商品入库,请输入相关信息 : endl endl ;cout name;cout endl price;cout endl count;cout endl storeNo;cout endl shelfNo;ofstream storeFile(store.txt, ios:app);storeFile setiosflags(ios:left) setw(20) name setw(15) price setw(10) count setw(10) storeNo shelfNo endl;storeFile.close();cout endl endl t该商品已经入库 . endl e

11、ndl t;system(pause);void mana:show_storage()bool flag2 = false;string name2;/商品名double price2;/介格string storeNo2;/仓库编号string shelfNo2;/货架号long count2 = 0; /商品数量ifstream showFile(store.txt);if (!showFile)cout t对不起,你的库存为空 ! endl endl t;system(pause);return;cout endl 商品名 价格 商品数量 仓库编号 货架号 endl name2 pri

12、ce2 count2 storeNo2 shelfNo2)cout setiosflags(ios:left) setw(10) name2 setw(10) price2 setw(10) count2 setw(10) storeNo2 shelfNo2 endl;8 / 18.showFile.close();getchar();void mana:out_storage()system(cls);string name;/商品名cout endl t商品出库,输入出库商品信息: endl endl;cout name;ifstream storeFile(store.txt);if (

13、!storeFile)ofstream storeFile1(store.txt);storeFile1.close();cout endl endl t仓存为空 ! endl endl name1 price1 count1 storeNo1 shelfNo1)if (name1=name)flag=true;while(name1=name)coutcount2;count1=count1-count2;break;tempFile setiosflags(ios:left) setw(10) name1 setw(15) price1 setw(10) count1 setw(10) s

14、toreNo1 setw(10) shelfNo1 endl;9 / 18.tempFile.close();storeFile.close();if (!flag)cout endl endl t 仓库中没有这种商品 ! endl endl t; system(pause);return;ofstream storeFile1(store.txt);ifstream tempFile1(temp.txt);storeFile1tempFile1.rdbuf();storeFile1.close();tempFile1.close();cout endl t这些商品已经出库 ,请仔细检查 !

15、endl endl t;system(pause);/ 查询void mana:select_ele()while (1)system(cls);cout endl endl;cout t= endl t| | endl t|商 品 查 询 | endl t| | endl t| 1.按商品名称查询 | endl t| | endl t| 2.按商品价格查询 | endl t| | endl t| 3.返回 | endl t| | endl t= endl endl tt;char select = getch();switch (select)case 1:10 / 18.select_na

16、me();break;case 2:select_price();break;case 3:return;default:break;void mana:select_name()system(cls);cout endl t按商品名查询 : endl endl ;cout name;string name1;/ 商品名double price1;/介格string storeNo1;/仓库编号string shelfNo1;/货架号long count1= 0; /商品数量ifstream storeFile(store.txt);if (!storeFile)cout t对不起,你的库存为

17、空 ! endl endl t;system(pause);return;bool flag = false;cout endl 商品名 价格 商品数量 仓库编号 货架号 endl name1 price1 count1 storeNo1 shelfNo1)if (name1 = name)flag = true;cout setiosflags(ios:left) setw(15) name1 setw(10) price1 setw(10) count1 setw(10) storeNo1 shelfNo1 endl;11 / 18.storeFile.close();if (!flag)

18、cout endl endl 对不起,库存中没有这种商品!;cout endl name2 price2 count2 storeNo2 shelfNo2)cout setiosflags(ios:left) setw(10) name2 setw(10) price2 setw(10) count2 setw(10) storeNo2 shelfNo2 endl;tempFile3.close;system(pause);/ 按商品价格查询void mana:select_price()system(cls);cout endl t按商品价格查询: endl endl ;cout price

19、;string name1;/商品名double price1;/介格string storeNo1;/仓库编号string shelfNo1;/货架号long count1 = 0; /商品数量ifstream storeFile(store.txt);if (!storeFile)cout endl endl t对不起,你的库存为空 ! endl endl 12 / 18.t;system(pause);return;bool flag = false;cout endl 商品名 价格 商品数量 仓库编号 货架号 name1 price1 count1 storeNo1 shelfNo1)if (price1 = price)flag = true;cout setiosflags(ios:left) setw(15) name1 setw(10) price1 setw(10) count1 setw(10) storeNo1 shelfNo1 endl;storeFile.close();if (!flag)cout endl endl 对不起,库存中没有这个价格的商品!;cout endl endl;system(pause);int main()char select;mana men;while (select = men.first_face()swit

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论