C++实习报告机动车管理信息系统.docx
- 文档编号:25395313
- 上传时间:2023-06-08
- 格式:DOCX
- 页数:34
- 大小:216.19KB
C++实习报告机动车管理信息系统.docx
《C++实习报告机动车管理信息系统.docx》由会员分享,可在线阅读,更多相关《C++实习报告机动车管理信息系统.docx(34页珍藏版)》请在冰豆网上搜索。
C++实习报告机动车管理信息系统
学号
面向对象应用程序设计课程设计
设计说明书
机动车信息管理系统
起止日期:
2020年7月6日至2020年7月10日
学生姓名
班级
成绩
指导教师(签字)
计算机与信息工程学院
2020年7月10日
目录
1、设计目的5
2、总体设计5
3、详细设计:
6
3.1、程序具体功能6
3.2、调试分析7
4、源程序和运行结果8
4.1、源程序8
4.2、运行结果20
4.3、心得体会24
机动车管理信息系统
1、设计目的
.通过实验实现对学生信息系统的管理操作;
.进一步掌握和利用C++进行程设计的能力;
.进一步理解和运用结构化程序设计的思想和方法;
.初步掌握开发一个小型实用系统的基本方法;
.学会利用流程图或N-S图表示算法;
.掌握书写程设计开发文档的能力(书写课程设计报告);
2、总体设计
3、详细设计:
3.1、程序具体功能:
(要求详细写明)
1、录入(录入车辆信息);
2、读取(读取车辆信息);
3、保存(保存录入信息);
4、浏览(浏览保存信息);
5、查询(查询保存信息);
6、修改(修改保存信息);
7、删除(删除保存信息);
8、排序(对保存信息排序);
3.2、调试分析(要求详细写明)
上机调试之前我们对所编的程序作了纸面上的检查,先改正一些不该犯错误,如{}没有搭配完整,漏写,拼写错误等,这些都是我们通过认真的态度在运行之前可以解决、避免的。
而且还可以减少机器时间。
往往一连串的错误是由于漏写或写错一个字符引起的。
在上机调试过程中,对文件这一节的知识还不够熟悉,所以在解决输入输出流的过程中出了很多问题。
问题如下:
1.对于函数不是很了解,例如排序时遇到困难,找了好多资料,请教别人才写出来
2.对于程序某些地方不是理解透彻,写的时候困难重重
3.排序函数写了好长时间才写出来
4.调试过程中发现输出的文字不够美观,对程序进行优化
5.从最初的90多个错误逐渐到0个
4、源程序和运行结果
4.1、源程序
#include
#include
#include
#include
usingnamespacestd;
classDate
{
private:
intyear,month,day;
public:
voiddisplay();
intget_year();
intget_month();
intget_day();
voidset_year();
voidset_month();
voidset_day();
voidset_all(inty,intm,intd);
};
voidDate:
:
set_all(inty,intm,intd)
{
year=y;
month=m;
day=d;
}
voidDate:
:
display()
{
cout< } intDate: : get_year() { returnyear; } intDate: : get_month() { returnmonth; } intDate: : get_day() { returnday; } voidDate: : set_year() { cout< "; cin>>year; } voidDate: : set_month() { cout<<"月: "; cin>>month; } voidDate: : set_day() { cout<<"日: "; cin>>day; } classCar { private: intcarid;//汽车ID stringcarname;//汽车名字 stringcartype;//汽车类型 doublebuyprice;//购买价格 doublesellprice;//折旧价格 stringfirm;//厂家 Datepurchase;//购置日期 public: Car(); Car(intci,stringcn,stringct,stringbp,stringsp,stringf,Datep); voidinput_Car(); voidoutput_Car(); intget_carid(); stringget_carname(); stringget_cartype(); doubleget_buyprice(); doubleget_sellprice(); stringget_firm(); Dateget_purchase(); voidset_carid(intci); voidset_carname(stringcn); voidset_cartype(stringct); voidset_buyprice(doublebp); voidset_sellprice(doublesp); voidset_firm(stringf); voidset_purchase(); voidset_all(intci,stringcn,stringct,doublebp,doublesp,stringf,intyear,intmonth,intday); ~Car(); }; Car: : Car() { carid=0; carname=""; cartype=""; buyprice=0; sellprice=0; firm=""; } Car: : Car(intci,stringcn,stringct,stringbp,stringsp,stringf,Datep){} voidCar: : input_Car() { cout<<"汽车ID: "; cin>>carid; cout<<"汽车名字: "; cin>>carname; cout<<"汽车类型: "; cin>>cartype; cout<<"购买价格(万元): "; cin>>buyprice; cout<<"折旧价格(万元): "; cin>>sellprice; cout<<"厂家: "; cin>>firm; cout<<"购置日期: "; purchase.set_year(); purchase.set_month(); purchase.set_day(); cout<<"添加汽车信息成功。 "< } voidCar: : output_Car() { cout< cout< } intCar: : get_carid() { returncarid; } stringCar: : get_carname() { returncarname; } stringCar: : get_cartype() { returncartype; } doubleCar: : get_buyprice() { returnbuyprice; } doubleCar: : get_sellprice() { returnsellprice; } stringCar: : get_firm() { returnfirm; } DateCar: : get_purchase() { returnpurchase; } voidCar: : set_carid(intci) { carid=ci; } voidCar: : set_carname(stringcn) { carname=cn; } voidCar: : set_cartype(stringct) { cartype=ct; } voidCar: : set_buyprice(doublebp) { buyprice=bp; } voidCar: : set_sellprice(doublesp) { sellprice=sp; } voidCar: : set_firm(stringf) { firm=f; } voidCar: : set_purchase() { purchase.set_year(); purchase.set_month(); purchase.set_day(); } voidCar: : set_all(intci,stringcn,stringct,doublebp,doublesp,stringf,intyear,intmonth,intday) { carid=ci; carname=cn; cartype=ct; buyprice=bp; sellprice=sp; firm=f; purchase.set_all(year,month,day); } Car: : ~Car() {} classCarSys { private: Carcar[1000]; intaccount; public: CarSys(); voidmenus();//显示菜单 voidinput_all(); voidoutput_all(); voidread_fromfile(); voidsave_tofile(); voidsearch_car(); voidsearch_menus(); voidchange_car(); voidchange_menus(); voidsort_car(); voidsort_menus(); voiddel_car(); voidoperate(); }; CarSys: : CarSys() { account=0; } voidCarSys: : menus()//总菜单 {
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- C+ 实习 报告 机动车 管理信息系统