CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 其他小程序

文件名称:CPPexam7zip

介绍说明--下载内容来自于网络,使用问题请自行百度

1. 声明一个基类 Animal,有私有整型成员变量 age,构造其派生类 dog,在其成员函

数 SetAge(int n)中直接给 age 赋值,看看会有什么问题,把 age 改为公有成员变量,还会有问题吗?编程试试看。

2. 声明一个基类 BaseClass,有整型成员变量 Number,构造其派生类 DerivedClass,

观察构造函数和析构函数的执行情况。

3. 声明一个车(vehicle)基类,具有 MaxSpeed、Weight 等成员变量,Run、Stop 等成员函数,由此派生出自行车(bicycle)类、汽车(motorcar)类。自行车(bicycle)类有高度(Height)等属性,汽车(motorcar)类有座位数(SeatNum)等属性。从 bicycle和 motorcar 派生出摩托车(motorcycle)类,在继承过程中,注意把 vehicle 设置为虚基类。如果不把 vehicle 设置为虚基类,会有什么问题?编程试试看。

-1. Declare a base class Animal, there are private integer member variable age, constructs its derived classes dog, in its member functions SetAge (int n) directly to the age assignment, to see what the problem is, the age to public member variables, there will be questions? Programming try. (2) declare a base class BaseClass, there is an integer member variable Number, construct its derived classes DerivedClass, observe the constructor and destructor implementation. 3 Declare a car (vehicle) base class, with MaxSpeed, Weight and other member variables, Run, Stop and other member functions, and derives a bike (bicycle), automobiles (motorcar) classes. Bike (bicycle) class has height (Height) and other attributes, automotive (motorcar) class has seats (SeatNum) and other attributes. Derived from the bicycle and motorcar motorcycle (motorcycle) class in the inheritance process, pay attention to the vehicle is set to the virtual base class. If you do not set the vehicle to the virtual base
(系统自动生成,下载前可以参看下载内容)

下载文件列表

7_1/
7_1/7_1.cpp
7_1/7_1.dsp
7_1/7_1.dsw
7_1/7_1.ncb
7_1/7_1.opt
7_1/7_1.plg
7_1/Debug/
7_1/Debug/7_1.exe
7_1/Debug/7_1.obj
7_1/Debug/7_1.pdb
7_1/Debug/StdAfx.obj
7_1/Debug/vc60.pdb
7_1/ReadMe.txt
7_1/StdAfx.cpp
7_1/StdAfx.h
7_2/
7_2/7_2.cpp
7_2/7_2.dsp
7_2/7_2.dsw
7_2/7_2.ncb
7_2/7_2.opt
7_2/7_2.plg
7_2/Debug/
7_2/Debug/7_2.exe
7_2/Debug/7_2.obj
7_2/Debug/7_2.pdb
7_2/Debug/StdAfx.obj
7_2/Debug/vc60.pdb
7_2/ReadMe.txt
7_2/StdAfx.cpp
7_2/StdAfx.h
7_3/
7_3/7_3.cpp
7_3/7_3.dsp
7_3/7_3.dsw
7_3/7_3.ncb
7_3/7_3.opt
7_3/7_3.plg
7_3/Debug/
7_3/Debug/7_3.exe
7_3/Debug/7_3.obj
7_3/Debug/7_3.pdb
7_3/Debug/StdAfx.obj
7_3/Debug/vc60.pdb
7_3/ReadMe.txt
7_3/StdAfx.cpp
7_3/StdAfx.h

相关说明

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

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com