文件名称:zeng

  • 所属分类:
  • 打印编程
  • 资源属性:
  • [Text]
  • 上传时间:
  • 2012-11-26
  • 文件大小:
  • 1kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • zeng****
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!
下载
别用迅雷、360浏览器下载。
如迅雷强制弹出,可右键点击选“另存为”。
失败请重下,重下不扣分。

介绍说明--下载内容均来自于网络,请自行研究使用

有一个汽车类vehicle,它具有一个需传递参数的构造函数,类中的数据成员——车轮个数wheels和车重weight放在保护段protected中;它有一个返回车轮个数的公有函数get_wheels,有一个返回车重的公有函数get_weight,有一个计算每个车轮的承载重量(车重除以车轮数)的公有函数wheel_load,一个公有的打印函数print,它将输出vehicle的车轮数和重量。

小车类car是它的私有派生类,包含一个私有数据成员载客量passenger_load,定义小车类的构造函数,一个获得载客量数目的公有成员函数get_passengers,一个公有的打印函数,它将输出小车的车轮数、重量和载客量。

卡车类truck也是它的私有派生类,包含两个私有数据成员载客量passenger_load和载重量payload,定义卡车类的构造函数,一个获得卡车载客量的公有函数get_passengers,一个获得卡车载重效率的公有函数efficiency(计算方法为载重量/(载重量+卡车本身的重量),一个公有的打印函数print,它将输出卡车的车轮数、重量、载客量和卡车载重效率)。

在car类和truck类中均可以直接访问vehicle类中的wheels和weight。

主函数中定义小车类对象car1(4,1000,5),卡车类对象tru1(10,5000,3,34000),然后调用car1和tru1的print函数。-There is a car class vehicle, it has a need to pass parameters to the constructor, the class data members- the number of wheels and vehicle wheels, heavy weight on the protection of the protected segment it has a number of public functions to return the wheel get_wheels, there is a return to the public function of vehicle weight get_weight, there is a calculation of the weight of each wheel load (vehicle weight divided by the number of wheels) in the public function of wheel_load, a public print function of print, it will output the number and weight of vehicle wheels.

Car class car is its private derived class that contains a private data member patronage passenger_load, the definition of small car class constructor, a number of public access to patronage member functions get_passengers, a public print function, it will output trolley wheel number, weight and capacity.

Pickup truck is also its private derived class contains two private data members of the load carrying capacity p相关搜索: zeng

(系统自动生成,下载前可以参看下载内容)

下载文件列表

zeng.txt

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org