车辆管理系统程序设计文档_第1页
车辆管理系统程序设计文档_第2页
车辆管理系统程序设计文档_第3页
车辆管理系统程序设计文档_第4页
车辆管理系统程序设计文档_第5页
已阅读5页,还剩19页未读 继续免费阅读

下载本文档

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

文档简介

车车 辆辆 管管 理理 系系 统统 程序设计程序设计 组员 邵剑恒 贺雅飞 陈丽如组员 邵剑恒 贺雅飞 陈丽如 目录目录 1 概述概述 1 1 课程设计的目的课程设计的目的 1 2 课程设计的内容课程设计的内容 2 需求分析需求分析 2 1 设计目标设计目标 2 2 主题功能主题功能 2 3 开发环境开发环境 3 总体功能图说明总体功能图说明 4 程序设计程序设计 4 3 程序流程图程序流程图 4 2 基本关系基本关系 4 1 基本组成基本组成 5 类设计类设计 5 1 基本组成基本组成 5 3 类图说明类图说明 5 2 基本关系基本关系 6 程序代码展示程序代码展示 7 用户手册用户手册 7 3 注意注意 7 2 具体过程具体过程 7 1 如何运行如何运行 1 概述概述 1 1 课程设计的目的课程设计的目的 为了检验一学期面向对象 C 的学习成果 同时为了考察将实际问 题与面向对象联系起来 并转换成编程问题的能力 1 2 课程设计的内容课程设计的内容 设计和实现一款能够管理车辆信息的系统 2 需求分析需求分析 2 1 设计目标设计目标 完成车辆信息的读取 调用及管理 2 2 主题功能主题功能 1 添加车辆 完成车辆信息的添加 要求编号唯一 当添加重复编 号是提示数据重复并不能添加 当车辆信息库已满时 提示不能添 加 2 查询车辆 a 按照车辆的制造公司查询 b 按照车辆编号查询 c 按照车辆类别查询 3 显示车辆信息库的信息 4 删除车辆信息 5 统计信息 6 车辆信息存盘 7 读出车辆信息 2 3 开发环境开发环境 Microsoft Visual C 3 总体功能图说明总体功能图说明 添加车辆信息 查 询 车 辆 显示 车辆 信 息 编 辑 信 息 删 除 信 息 统 计 信 息 操 作 信 息 读出信息 4 程序设计程序设计 4 1 基本组成基本组成 类 main 函数 类中成员函数定义 4 2 基本关系基本关系 Main 函数现实系统主界面 并且同来调用类及类中成员函数 4 3 程序流程图程序流程图 Main 所有类 类成员函数 5 类设计类设计 5 1 基本组成基本组成 1 汽车基本信息类 cars 包含车辆所有的基本信息 包括车辆牌 号 车牌号 车辆制造公司 车辆购买时间 车辆型号 总公里数 耗油量 基本维护费用 养路费 基本总费用 2 各种车型的类 bus gs ss 包含各种车辆的独有的信息 3 功能类 zonghe 包括对车辆信息的处理功能函数 5 2 基本关系基本关系 bus gs ss 继承 cars zonghe 同时继承 bus gs ss 5 3 类图说明类图说明 Cars busgsss zonghe 6 程序代码展示程序代码展示 include include include include using namespace std 类的定义 virtual class cars protected int number time BMcost total cost string company type identifier float mile road toll fuel consumption public class bus virtual public cars protected float busload public class gs virtual public cars protected float load public class ss virtual public cars protected int wing room public class zonghe public bus public gs public ss public void add void find void edit void add2 void dele void count void ji void qing 由此开始主函数 void main cars c0 bus c1 gs c2 ss c3 zonghe c4 while 1 cout endl cout 1 首次添加数据 2 信息查询 3 信息追加 endl cout 4 信息统计显示 5 信息删除 6 信息修改 endl cout 7 安全退出 8 车辆统计 9 清屏 endl endl cout 备注 输入时 各数据项之间 请用空格相隔 endl cout x switch x case 1 c4 add break case 2 c4 find break case 3 c4 add2 break case 4 c4 count break case 5 c4 dele break case 6 c4 edit break case 7 exit 0 case 8 c4 ji break case 9 c4 qing break 主函数到此结束 主函数到此结束 录入函数 void zonghe add ifstream infile ofstream outfile int val a 0 b 0 c 0 d outfile open car txt while 1 cout 请输入车辆信息 endl cout 编号 车牌 购时 基维费 总费用 制造商 车型 总公里 养路费 耗油量 载客量 载货量 厢数 identifier number time BMcost total cost company type mile road toll fuel consu mption busload load wing room outfile identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room endl if type gs a else if type bus b else if type ss c cout 1 结束输入 2 继续输入 val if val 1 break infile close outfile close outfile open shuliaang txt d a b c outfile d a b c endl outfile close infile open shuliaang txt 查询函数 void zonghe find while 1 string c1 int i j val ifstream infile ofstream outfile infile open car txt if infile cout 数据库为空 请先录入数据 endl exit 0 cout 请选择查询方式 endl cout 1 制造公司 2 编号 3 类别 i if i 1 j 0 cout c1 while infile identifier number time BMcost total cost company type mile road toll fuel consumpti on busload load wing room if c1 company cout 编号 车牌 购时 基维费 总费用 制造商 车型 总 公里 养路费 耗油量 载客量 载货量 厢数 endl cout identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room endl j 1 else if i 2 j 0 cout c1 while infile identifier number time BMcost total cost company type mile road toll fuel consumpti on busload load wing room if c1 identifier cout 编号 车牌 购时 基维费 总费用 制造商 车型 总 公里 养路费 耗油量 载客量 载货量 厢数 endl cout identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room endl j 1 else if i 3 j 0 cout c1 cout 编号 车牌 购时 基维费 总费用 制造商 车型 总 公里 养路费 耗油量 载客量 载货量 厢数 identifier number time BMcost total cost company type mile road toll fuel consumpti on busload load wing room if c1 type cout identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room endl j 1 else cout 输入错误 请重新输入 endl i 2 infile close outfile close if j 0 cout 您所要查询的信息不存在嘛哦 endl cout 1 结束 2 继续查询 val if val 1 break 编辑功能 void zonghe edit while 1 string c1 int i 0 a 0 b 0 c 0 d val ifstream infile in in1 ofstream outfile out out1 infile open car txt outfile open fuben txt if infile cout 数据库为空 请先录入数据 endl exit 0 cout 请输入编号 c1 in1 open shuliaang txt ios in in1 d a b c in1 close while infile identifier number time BMcost total cost company type mile road toll fuel consumpti on busload load wing room if c1 identifier if type gs a else if type bus b else if type ss c cout 请输入修改后的信息 endl cout 编号 车牌 购时 基维费 总费用 制造商 车型 总公里 养路费 耗油量 载客量 载货量 厢数 identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room outfile identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room endl i 1 if type gs a else if type bus b else if type ss c else outfile identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room endl if i 0 cout 你所输入的编号不存在 identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room out identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room endl infile close outfile close out1 open shuliaang txt ios out d a b c out1 d a b c endl out1 close cout 1 结束 2 继续修改 val if val 1 break 增加函数 void zonghe add2 while 1 ifstream infile in ofstream outfile out int number1 time1 BMcost1 total cost1 wing room1 i 1 a 0 b 0 c 0 d val string company1 type1 identifier1 float mile1 road toll1 fuel consumption1 load1 busload1 infile open car txt ios in if infile cout 数据库为空 请先录入数据 endl exit 0 cout 请输入你所想添加的信息 endl cout 编号 车牌 购时 基维费 总费用 制造商 车型 总公里 养路费 耗油量 载客量 载货量 厢数 identifier1 number1 time1 BMcost1 total cost1 company1 type1 mile1 road toll1 f uel consumption1 busload1 load1 wing room1 while infile identifier number time BMcost total cost company type mile road toll fuel consumpti on busload load wing room if identifier1 identifier cout 你所输入的编号已经存在 d a b c in close if i 1 outfile open car txt ios app outfile identifier1 number1 time1 BMcost1 total cost1 company1 type1 mile1 road toll1 fuel consumption1 busload1 load1 wing room1 endl if type1 gs a else if type1 bus b else if type1 ss c outfile close out open shuliaang txt ios out d a b c out d a b c endl out close cout 1 结束 2 继续增加 val if val 1 break 删除函数 void zonghe dele while 1 string c1 int a 0 b 0 c 0 d i 0 val ifstream infile in ofstream outfile out out1 infile open car txt outfile open fuben txt if infile cout 数据库为空 请先录入数据 endl exit 0 cout 请输入车辆的编号 c1 while infile identifier number time BMcost total cost company type mile road toll fuel consumpti on busload load wing room if c1 identifier outfile identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room out identifier number time BMcost total cost company type mile road toll fuel consumption busload load wing room endl infile close outfile close out1 open shuliaang txt d a b c out1 d a b c endl out1 close cout 删除成功 endl else cout 您所输入的编号不存在 endl

温馨提示

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

评论

0/150

提交评论