仓库管理系统C++课程设计报告.doc

上传人:w****2 文档编号:6475039 上传时间:2020-02-27 格式:DOC 页数:18 大小:85.50KB
返回 下载 相关 举报
仓库管理系统C++课程设计报告.doc_第1页
第1页 / 共18页
仓库管理系统C++课程设计报告.doc_第2页
第2页 / 共18页
仓库管理系统C++课程设计报告.doc_第3页
第3页 / 共18页
点击查看更多>>
资源描述
高级语言程序设计课程设计报告设计题目 图书管理系统 专 业 计算机科学与技术 班 级 姓 名 学 号 2007 年6 月 5 日目 录1.设计目的32.设计思想33.类及对象设计44.程序源代码55.调试记录166.总结18 仓库管理系统1 设计目的 通过实习进一步掌握所学的基本知识,学会解决实际问题的方法2 设计题目1、问题描述(功能要求):某公司现有以下设备:普通电视机、DVD、带DVD的电视机,带DVD的电视机的售价为普通电视机和DVD单价之和的80%,要求对所有的库存设备都能按照品名进行显示、查找、增加和删除、保存的功能。2、问题的解决方案:根据系统功能要求,可以将问题解决分为以下步骤: (1)分析系统中的各个实体之间的关系及其属性和行为; (2)根据问题描述,设计系统的类层次; (3)完成类层次中各个类的描述(包括属性和方法); (4)完成类中各个成员函数的定义; (5)完成系统的应用模块; (6)功能调试; (7)完成系统总结报告以及系统使用说明书。2设计思想(1) 设计class admin管理库,实现对仓库信息的描叙; class shelf柜台类库实现建立电器资料;class ele电器类,实现对电器的描述,电器的编号,货架号,名称,数量,价格等;class 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()商品保存(2)用类的成员函数对链表的数据进行操作,其功能如上表所列。(3)设计菜单来实现功能设计 1、 输入商品 2、 商品查找 3、 查询入库 4、 商品出库 5 、退出系统3设计类及对象(1) 本程序定义了四个类,定义如下:class adminpublic:admin();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();/入库void 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 定义了各自的对象admin 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;/仓库编号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();/入库void 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;/商品数量shelf:shelf():we()storeNo = xxx;/仓库编号shelfNo = xxx;/货架号admin:admin()name = xxx;mana:mana():aele(), ashelf(), abs()char mana:first_face()system(cls);cout endl;cout endl ttendl tt endl tt 公司库存货物管理系统 endl tt endl 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 tt endl 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 商品入库,请输入相关信息 : 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 endl 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 price2 count2 storeNo2 shelfNo2)cout setiosflags(ios:left) setw(10) name2 setw(10) price2 setw(10) count2 setw(10) storeNo2 shelfNo2 endl;showFile.close();getchar();void mana:out_storage()system(cls);string name;/商品名cout endl t商品出库,输入出库商品信息 : endl endl;cout name;ifstream storeFile(store.txt);if (!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) storeNo1 setw(10) shelfNo1 endl;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这些商品已经出库, 请仔细检查! 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:select_name();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对不起,你的库存为空! 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;storeFile.close();if (!flag)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;string name1;/商品名double price1;/介格string storeNo1;/仓库编号string shelfNo1;/货架号long count1 = 0; /商品数量ifstream storeFile(store.txt);if (!storeFile)cout endl endl t对不起,你的库存为空! endl endl 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()switch (select)case 2:men.show_storage();break;case 3:men.select_ele();break;case 1:men.in_storage();break;case 4:men.out_storage();break;case 6:men.show_storage1();case 5:cout t 谢谢使用! endl endl tt;exit( 0 );break;default:break;return 0;5.调试纪录 1、电器管理界面2、程序的主界面以及图书维护界面 3、查找读者功能界面6总结 通过这次课程设计,让我了解了更多关于设计时容易出现的错误,而且进一步的认识到平时学习积累的重要性。在刚进行编译的时候发现了很多的错误,都是平时应该注意的细节问题,还好与同学进行了很好的交流,得以纠正错误。 由于能力问题,我只能设计这个简单的图书管理系统。它存在很多缺陷,在很多地方都存在不足。编写程序最重要的是谨慎,认真,因为哪怕是一个字符或一个标点的错误都会导致程序的错误,从而使程序无法调试运行。 由这次编写课程设计的过程中让我更加了解到了自己的不足,那就是对编写程序的经验不足以及对理论知识的掌握不够透彻,以致程序中还存在许多缺点。如:在程序中还有部分功能不能按我的意识表达运行,当经人指点还是比较不错的实现了。参考资料 本程序参考书本:C+程序设计课程设计高级语言C+程序设计
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 管理文书 > 工作总结


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!