已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
专专 业 软件工程业 软件工程 学学 号 号 姓姓 名 韩晨昱名 韩晨昱 提交日期 提交日期 2017 1 122017 1 12 C 课程设计报告 C 课程设计报告 1 设计目的 1 设计一个较为简单的 商场库存货物管理系统 进一步熟悉 C 中类的概念 类的封装 继承的实现方式 2 了解系统开发的需求分析 类层次设计 模块分析 编码测试 模块组装与整体调试 的全过程 加深对 C 的理解与 Visual C 环境的使用 逐步熟悉程序设计的方法 并养 成良好的编程习惯 设计内容 该程序用于商场对于货物整理查询的等需求 为了更好的处理货物的详细信息包括货 物的入库 出库 查询 统计并且能够了解商场仓库系统 能够查找 增加 删除 保存各类商品的信息 使商场的管理者对于商场内的货物信 息状况有一个准确的了解 并及时对商场的情况做一个及时的调整 作为一个商场系统 添加了货物的新功能 深层次多方面的简化了货物关系的整体性 系统要求能够按编号显示 查找 增加删除和保存各类信息 输入和输出货物的有关 信息 并且对输入保存文件里确定程序具备以下工能 查询模块 增加模块 删除模块 货物的有关数据存盘等基本模块 作为一个完整得系统 除了具有增加货物删除模块 还 具有修改货物相关信息的功能 所以本系统具备了 商品入库 商品出库 查询统计 商品报损 查询统计 这 5 个基本的功能 就可以用简洁的方式实现对货物的管理也就实现 了系统的要求 实验环境 1 硬件环境 ASUS 电脑 8G 内存 酷睿 I5 2 软件环境 windows10 操作系统 visual studio 2015 设计中使用函数说明 char manage homepage 操作主页函数 void manage instorage 入库函数 void manage outstorage 出库函数 void manage find 查询函数 void manage findname 按名称查询函数 void manage findprice 按价格查找函数 void manage findkind 按种类查找 void manage call break 报损函数 测试结果 1 商场库存管理首页 C 课程设计报告 2 2 商品的入库管理 3 商品查询 C 课程设计报告 3 4 商品报损 C 课程设计报告 4 5 商品出库 设计总结 通过小组人员的共同努力 使我们能够基本掌握 C 程序设计的方法 并且在此基础上 掌握类的构造方法 明确类中构造函数 成员函数的建立以及调用 此外 通过不断地练 习 C 编码方式 我们得以将自己所学通过代码表现出来 培养了我们的团队意识 增加 了我们编码的熟练度 参考文献 C 面向对象程序设计 谭浩强 源程序清单 include C 课程设计报告 5 include include include include include include 类 h include 函数 h using namespace std class administor public administor private string name 仓库货架类 class shelf public shelf private administor administor 管理员 string storeNo 仓库编号 string kinds 商品大类 string shelfNo 货架号 class goods public goods private string name 商品名 double price 价格 shelf shelf 所属货架 long number 商品数量 管理类 class manage public manage char homepage 首页 C 课程设计报告 6 void instorage 入库 void outstorage 出库 void find 查询 void findname 按商品名称查询 void findprice 按商品价格查询 void findkind 按大类查询 void call break 商品报损 private goods aele shelf ashelf administor abs 电器类默认构造函数 goods goods shelf name xxx 商品名 price 0 0 价格 number 0 商品数量 仓库货架类默认构造函数 shelf shelf administor storeNo xxx 仓库编号 kinds xxx 商品大类 shelfNo xxx 货架号 仓库管理员类 administor administor name xxx 管理类默认构造函数 manage manage aele ashelf abs char manage homepage system cls cout endl C 课程设计报告 7 cout endl t t endl t t endl t t 商场库存货物管理系统 endl t t endl t t 1 商品入库 endl t t endl t t 2 商品出库 endl t t endl t t 3 查询统计 endl t t endl t t 4 商品报损 endl t t endl t t 5 退出系统 endl t t endl t t endl endl t t return getch 入库 void manage instorage system cls string name 商品名 double price 价格 string storeNo 仓库编号 string kinds 商品大类 string shelfNo 货架号 long number 0 商品数量 cout endl 商品入库 请输入相关信息 endl endl cout name cout endl price cout endl number cout endl storeNo cout endl kinds cout endl shelfNo C 课程设计报告 8 ofstream storeFile store txt ios app storeFile setiosflags ios left setw 20 name setw 15 price setw 10 number setw 10 storeNo setw 20 kinds shelfNo endl storeFile close cout endl endl t该商品已经入库 endl endl t system pause 出库 void manage outstorage 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 kinds1 shelfNo1 C 课程设计报告 9 if name1 name flag true else tempFile setiosflags ios left setw 20 name1 setw 15 price1 setw 10 count1 setw 10 storeNo1 setw 20 kinds1 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 storeFile1 tempFile1 rdbuf storeFile1 close tempFile1 close cout endl t这些商品已经出库 请仔细检查 endl endl t system pause 查询 void manage find while 1 system cls cout endl endl cout t endl t endl t 商 品 查 询 endl t endl C 课程设计报告 10 t 1 按商品名称查询 endl t endl t 2 按商品价格查询 endl t endl t 3 按大类查询 endl t endl t 4 返回 endl t endl t endl endl t t char select getch switch select case 1 findname break case 2 findprice break case 3 findkind break case 4 return default break 按商品名称查询 void manage findname system cls cout endl t按商品名查询 endl endl cout name string name1 商品名 double price1 价格 string storeNo1 仓库编号 string kinds1 商品大类 C 课程设计报告 11 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 商品名 价格 商品数量 仓库编号 商品大类 货架号 endl name1 price1 count1 storeNo1 kinds1 shelfNo1 if name1 name flag true cout setiosflags ios left setw 15 name1 setw 10 price1 setw 10 count1 setw 10 storeNo1 setw 15 kinds1 shelfNo1 endl storeFile close if flag cout endl endl 对不起 库存中没有这种商品 cout endl endl system pause 按商品价格查询 void manage findprice system cls cout endl t按商品价格查询 endl endl cout price string name1 商品名 double price1 价格 C 课程设计报告 12 string storeNo1 仓库编号 string kinds1 商品大类 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 商品名 价格 商品数量 仓库编号 商品大类 货架号 endl name1 price1 count1 storeNo1 kinds1 shelfNo1 if price1 price flag true cout setiosflags ios left setw 15 name1 setw 10 price1 setw 10 count1 setw 10 storeNo1 setw 15 kinds1 shelfNo1 endl storeFile close if flag cout endl endl 对不起 库存中没有这个价格的商品 cout endl endl system pause 按大类查询 void manage findkind system cls cout endl t按商品大类查询 endl endl cout kinds C 课程设计报告 13 string name1 商品名 double price1 价格 string storeNo1 仓库编号 string kinds1 商品大类 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 商品名 价格 商品数量 仓库编号 商品大类 货架号 endl name1 price1 count1 storeNo1 kinds1 shelfNo1 if kinds1 kinds flag true cout setiosflags ios left setw 15 name1 setw 10 price1 setw 10 count1 setw 10 storeNo1 setw 15 kinds1 shelfNo1 endl storeFile close if flag cout endl endl 对不起 库存中没有这类商品 cout endl endl system pause 商品报损 void manage call break system cls string name 商品名 C 课程设计报告 14 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 t system pause return bool flag false string name1 商品名 double price1 价格 string kinds1 商品大类 string shelfNo1 货架号 long count1 0 商品数量 ofstream tempFile temp txt string storeNo1 仓库编号 cout endl endl 你想报损商品信息如下 endl endl cout endl 商品名 价格 商品数量 仓库编号 商品大类 货架号 endl name1 price1 count1 storeNo1 kinds1 shelfNo1 if name1 name flag true cout setiosflags ios left setw 15 name1 setw 10 price1 setw 10 count1 setw 10 storeNo1 setw 15 kinds1 shelfNo1 endl shelfNo1 损坏 tempFile setiosflags ios left setw 20 na
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年医疗健康应用合成生物学市场趋势研究报告
- 医疗领域腐败问题集中整治自查工作报告
- 2026年电子竞技行业市场分析报告及未来展望
- 2026年云南省昆明市辅警协警笔试测模拟试卷带答案
- 2026年低压电工考试模拟考试题库(含答案)
- 2026年广东电工证考试模拟题及参考答案
- 2026年煤矿工人考试模拟题库及答案
- 2026年井控考试题库(含答案)
- 南京大学计算机应用期末考试模拟试卷及答案
- 2026年计算机文化基础考试模拟试卷一及答案
- 高甘油三酯血症管理专家共识(2025版)
- 体育场馆安全生产管理台账
- 2026年(完整版)院前急救知识培训题(含答案)
- 2026年行测类题库及答案详解
- 东航校招的在线测评题目2026
- 初中七年级语文《小圣施威降大圣》教学设计
- 2026语文新教材 1第24课《我将无我不负人民》
- 2026安徽省考评员培训考试题库及答案
- 凝心聚力共逐梦家校携手启新程
- 2025年建设单位对监理单位标后履约情况评价表
- 美的电磁炉C21-SK2105电路图
评论
0/150
提交评论