文件名称:CPPexam7zip

  • 所属分类:
  • 其他小程序
  • 资源属性:
  • [Windows] [Visual C] [源码]
  • 上传时间:
  • 2013-11-22
  • 文件大小:
  • 819kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • w***
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

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

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.cpp

...\7_1.dsp

...\7_1.dsw

...\7_1.ncb

...\7_1.opt

...\7_1.plg

...\Debug

...\.....\7_1.exe

...\.....\7_1.obj

...\.....\7_1.pdb

...\.....\StdAfx.obj

...\.....\vc60.pdb

...\ReadMe.txt

...\StdAfx.cpp

...\StdAfx.h

7_2

...\7_2.cpp

...\7_2.dsp

...\7_2.dsw

...\7_2.ncb

...\7_2.opt

...\7_2.plg

...\Debug

...\.....\7_2.exe

...\.....\7_2.obj

...\.....\7_2.pdb

...\.....\StdAfx.obj

...\.....\vc60.pdb

...\ReadMe.txt

...\StdAfx.cpp

...\StdAfx.h

7_3

...\7_3.cpp

...\7_3.dsp

...\7_3.dsw

...\7_3.ncb

...\7_3.opt

...\7_3.plg

...\Debug

...\.....\7_3.exe

...\.....\7_3.obj

...\.....\7_3.pdb

...\.....\StdAfx.obj

...\.....\vc60.pdb

...\ReadMe.txt

...\StdAfx.cpp

...\StdAfx.h

相关说明

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

相关评论

暂无评论内容.

发表评论

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

源码中国 www.ymcn.org