




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、一、设计题目 . 1 二、设计目的 . 1 三、设计说明 . 1 四、总体设计 . 2 五、详细设计 . 3 六、结论 . 7 七、附录(程序源代码) : 7 1 / 47 、 设 计题目 汽车汽修管理系统 二、设计目的 1. 通过课程设计掌握面向对象的程序设计思路。 2. 通过课程设计掌握类的继承、抽象类、多态、虚基类的应用方法。 3. 通过课程设计掌握C+中对文件进行查找、删除、修改等操作方法。 三、设计说明 1. 系统功能需求描述 本系统主要实现车辆信息、车辆修理单信息的插入、删除及查询等功能。 编程实现汽车汽修管理系统,主要汽车汽修管理系统。其中车辆信息应该包括 车牌号、牌号、型号、生
2、产厂家、修理项目码、修理日期、修理项目、修理小 时数、完工日期。车辆修理菜单信息包括修理单编号、修理工工号、修理日期、 修理项目、修理小时数、完工日期。具体功能如下: (1) 用户登录界面设计。 (2) 信息维护:包括车辆信息维护:增加车辆信息、删除车辆信息、膝盖车 辆信息。包括车辆修理单信息维护:增加车辆修理单信息、删除和良修理单信 息、修改车辆修理单信息。 (3) 信息查询:对车辆信息查询时可实现按车辆名查询、按车主名查询等多 条件查询。对车辆修理单信息查询时可实现按车辆修理单号查询、按修理工工 号查询等多条件查询。 (4) 修理单统计:按月统计输出上的汽车修理单信息。按月统计每个修理工
3、的月修理信息。 2. 系统运行环境 (1) 硬件环境。本系统适用于那种 Inter386 以上计算机,内存容量为 128M, 应配备键盘、鼠标、显示器等外部设备。 (2) 软件环境。本系统的设计采用 Visual C+6.0编写。在WindowsXPSP2 环境下测试通过 四、总体设计 1. 数据设计 (1) 类设计 车辆信息类car_infor,该类有共同的信息车牌号 car_no、牌号car_brand、 型号 car_modles、生产厂家 manufacturer、修理项目码 repair_code、车主姓 名owner_name 联系电话 phone_nombe、修理日期 repai
4、r_time。车辆修理菜 单信息类repair_list,该类有共同的修理单编号list_no、修理工工号 repaiman_no、修理日期 repair_time、修理项目 project、修理小时数 repair_hours、完工日期 complete_time。用户信息类 user,该类有成员用户名 user_name密码password。功能类fun,该类中包含所有的功能函数,实现对 车辆信息及车辆修理单信息的增加、修改、删除以及统计等实用功能。void add() 增加车辆信息,void del()删除车辆信息,void modify ()修改车辆信息,void add_list()
5、增加车辆修理单信息,void del_list() 删除车辆修理单信息,void modify_list()修改车辆修理单信息,int Judge()判断函数,void query_car() 查询车辆信息,void query_list()查询车辆修理单信息,void query_car_no() 按车辆名查询,void query_owner_name() 按车主名查询,void query_repaiman_no()按修理工工号查询,void query_rlist_no()按车辆修理 单号查询,Statistics()修理单统计等。 (2) 函数设计 Int registe()用户注册
6、,int Judge6() 用户登录,void add()增加车辆信 息,void del()删除车辆信息,void add_list()增加车辆修理单信息,void modify ()修改车辆信息,void del_list()删除车辆修理单信息,void modify_list()修改车辆修理单信息,int Judge()判断函数,void query_car() 查询车辆信息,void query_list()查询车辆修理单信息,void query_car_no() 按车辆名查询,void query_owner_name() 按车主名查询,void query_repaiman_no
7、()按修理工工号查询,void query_rlist_no()按车辆修理 单号查询,void Statistics()1按月输出汽车修理单信息,void Statistics()2 统计每个修理工的月修理信息。 2. 结构设计 系统流程图如图4-1所示 1 / 47 Mail函 数 车辆修理单车辆修理单车辆修理单 车辆修理单 信息增加 信息删除信息查询 / j 信息修改车辆修理单车辆信息修 J丿、/ Vh 车辆信息车辆信息车辆信息增 查询删除力卩 void 厂 void “ void ( Void f void、 / voidd / void addist() del_list() quer
8、y_list()modify_list()Statistics() modify() query_car() voi e ( add() void 图4-1系统流程图 五、详细设计 (1)用户登录/注册界面设计 欢迎使用汽车哄修管理系统 1用户登录 鑒用户注珊 JCJOCKJtXMLMXKJCXM: 欢迎登录F气车汽修管理系纟充 用户名:adam 吊斗-j_21? 登亲灰功红请按任意键继练 图5-1用尸登录界面 此界面用户通过选择进行登录、注册操作,通过调用函数registe() ,Judge6 ()实现相关功能。 (2)汽车汽修管理系统界面 亠一t_gi WWW it 保施 车r躋唇 5脍车
9、将核3里单 2 / 47 图5-2汽车汽修管理系统界面 通过用户选择相关功能进行操作,由men u()函数实现显示功能,用户根据 相关提示进入下一步。 (3) 增加车辆信息 ;鴛;嘉睪翟置 0 -返回上一菜单 请输入您的选扌 请按扌是示输入丰辆信息= 车牌号诃豳 汽车曲牌号;奔驰 汽牟的型号:奔驰 /* 车辆信息类 * Class Car_infor publiC: Car_infor() private: string Car_no;/ 车牌号 string Car_brand;/ 牌号 string Car_modles;/ 型号 string manufaCturer;/ 生产厂家 st
10、ring repair_code;/修理项目码 string owner_name;/车主姓名 string phone_number;/联系电话 string repair_time;/修理日期 ; /* 修理单类 * class repair_list public: repair_list() private: string list_no;/ 修理单编号 string repairman_no;/ 修理工工号 string repair_time;/ 修理日期 string project;/ 修理项目 string repair_hours;/修理小时数 string complet
11、e_time;/ 完工日期 ; /* 用户信息类 * class user public: user() private: string user_name;/用户名 string password;/密码 ; /* 功能类 * class fun /* 信息维护 * public: fun() /* 增加车辆信息 * void add() system(cls); string a,b,c,d,e,f,g,h; string line; ofstream car(d:cars.txt, ios:app); if(!car) cerropen error!endl; exit(1); int
12、flag=1; while(flag) coutendlendl; coutttt * endl; coutttt1. 增加汽车信息 endlendl; coutttt0. 返回上一菜单 endl; coutttt * endl; coutn; switch(n) case 1: system(cls); coutendl; coutt 请按提示输入车辆信息 :endlendl; couta; coutendl; coutb; coutendl; coutc; coutendl; coutd; coutendl; coute; coutendl; coutf; coutendl; coutg;
13、 coutendl; couth; coutendl; car setiosflags(ios:left)a b c d e f g hendl; system(cls); cout endl tt信息录入完成 ! endl endl; system(pause);break; case 0:flag=0;system(cls);break; default:system(cls);coutendlendlendlabcdefgh; if(car_n=a) return 1; return 0; /* 删除车辆信息 * void del() system(cls); string a,b,c,
14、d,e,f,g,h; string line; string car_no; ifstream car(d:cars.txt); if(!car) cerrcars.txt cant open!endl; exit(1); ofstream temp(d:temp.txt); if(!temp) cerrtemp.txt cant open!endl; exit(1); int flag=1; while(flag) coutendlendl; coutttt * endl; coutttt1. 删除车辆信息 endlendl; coutttt0. 返回上一菜单 endl; coutttt *
15、 endl; coutn; switch(n) case 1: string car_n; coutendl; coutcar_n; if(Judge1(car_n,line)=1) system(cls); coutendlendlendl; couttt 存 在 这 辆 汽 车 , 确 定 要 删 除 ? (Y/N)endlendl; couttt 请输入您的选择 :endl; coutch; switch(ch) case Y:while(getline(car,line) string line; string car_n; string car_no; couttt 请再次输入要删除
16、的车辆的车牌 号:e ndl; coutcar_n; ifstream car(d:cars.txt); ofstream temp(d:tem.txt); while(getline(car,line) istringstream is(line); isabcdefgh; if(!car) cout 您要的信息不存在 ; if(car_n!=a) tempsetiosflags(ios:left)a b c d e f g hendl; ofstream car1(d:cars.txt,ios:trunc); ifstream temp1(d:tem.txt); while(getline
17、(temp1,line) abcdefgh; car1setiosflags(ios:left) setw(20) a b c d e f g hendl; ofstream temp2(d:tem.txt,ios:trunc); temp2.close(); car.close(); car1.close(); temp.close(); temp1.close(); system(cls); coutendlendlttt 信 息 已 成 功 删 除!e ndle ndl; flag1=0; ;break; case N:system(cls);continue;break; defaul
18、t:system(cls);coutendlendlendlttt输入错误 ! 请重新 输 入! ;/+ else system(cls); cout endlendl ttt 没 有 这 辆 车 的 信 息!e ndle ndl; break; ;break; case 0:flag=0;break; default:system(cls);coutendlendlendlttt输入错误 ! 请 重新输入 !; car.close (); temp.close(); 修改车辆信息 * void modify() system(cls); string a,b,c,d,e,f,g,h; str
19、ing line; string car_n; coutendl; ifstream car(d:cars.txt); if(!car) cerrcars.txt cant open!endl; exit(1); ofstream temp(d:tem.txt); if(!temp) cerrtem.txt cant open!endl; exit(1); int flag=1,flag1=1; while(flag) coutendlendl; coutttt * endl; coutttt1. 修改车辆信息 endlendl; coutttt0. 返回上一菜单 endl; coutttt
20、* endl; coutn; switch(n) case 1: string car_n; coutendl; coutttt 请输入要修改的汽车号码 :endl; coutcar_n; if(Judge1(car_n,line)=1) system(cls); coutendlendlendl; couttt存在这辆汽车,确定修改?(Y/N)endl; couttt请输入您的选择 :endl; coutch; switch(ch) case Y: while(getline(car,line) string line; string car_n; string car_no; 号:e nd
21、l; couttt 请再次输入要修改的车辆的车牌 coutcar_n; ifstream car(d:cars.txt); ofstream temp(d:tem.txt); while(getline(car,line) istringstream is(line); isabcdefgh; if(!car) cout 您要的信息不存在 if(car_n!=a) tempsetiosflags(ios:left)a b c d e f g habcdefgh; car1setiosflags(ios:left) setw(20) a b c d e f g hendl; ofstream temp2(d:tem.txt,ios:trunc); temp2.close(); temp.close(); temp1.close(); system(cls); coutendl; couttt 请 按 提 示 重 新 输 入 车 辆 信 息:e ndle ndl; couta; coutendl; coutb; coutendl; coutc; coutendl; coutd; coutendl; coute; coutendl; coutf; coutendl; coutg; coutendl; couth; coutendl; car1 setiosflags(io
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 英国罗伯特与学前教育发展史
- 工厂设计答辩结论撰写要点
- 工程项目管理学习资源试题及答案
- 行政管理经济法申诉案例试题及答案
- 社会教育节约用水实施路径
- 2025年工程经济经典例题试题及答案
- 冲刺抢分卷03 备战2025年高考考前仿真模拟卷冲刺抢分卷化学试题03 (辽宁、黑龙江、吉林、内蒙古专用) 含解析
- 生产航天无人机领域装置、海底深水探测动力装置、工业母机直线电机项目可行性研究报告写作模板-备案审批
- 如何优化工程绩效评估试题及答案
- 现代工程经济应用实践试题及答案
- 2024国有土地房屋买卖合同
- 招标采购专项治理自查报告
- 2023-2024学年江苏省昆山市七下英语期末统考试题含答案
- 2024中考语文复习 文学文化常识
- 国家开放大学《Python语言基础》实验4:条件分支结构基本应用参考答案
- 口腔医院护理人员礼仪培训课件
- 钢结构工程施工组织设计完整版
- 《田间药效试验》课件
- JJG 443-2023燃油加油机(试行)
- 机械工业出版社2020《人工智能导论》课程第1章 绪论
- 教育教学实习教案幼儿园
评论
0/150
提交评论