文件名称:lab8
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:1.34kb
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
1. 编写程序定义Point类,在类中定义整型的私有成员变量_x、_y,对Point类重载“++”(自增) “--”(自减)运算符,实现对坐标值的改变。
2. 编写程序定义一个车(vehicle)基类,有Run、Stop等成员函数,由此派生出自行车(bicycle)类、汽车(motorcar)类,从bicycle和motorcar派生出摩托车(motorcycle)类,它们都有Run、Stop等成员函数。观察虚函数的作用。
3. (选做)对实验2中的people类重载“= =”运算符和“=”运算符,“==”运算符判断两个people类对象的id属性是否相等;“=”运算符实现people对象的赋值操作
-1. Preparation process definition Point class defined in the class integer private member variables _x, _y, of the Point class overload "++"( increment) "--"( decrement) operator, to realize coordinates value changes.2. Write a program to define a car (vehicle) base class, with Run, Stop and other member functions, thus derived a bike (bicycle), automobiles (motorcar) class, derived from the bicycle and motorcar motorcycle (motorcycle) class, They all have Run, Stop and other member functions. Observe the role of virtual functions.3. (Elected to do) to Experiment 2 in the people category overloaded "= =" operator and "=" operator ,"==" operator to judge two people of the id attribute class object is equal "=" operator Fu realize people object assignment
2. 编写程序定义一个车(vehicle)基类,有Run、Stop等成员函数,由此派生出自行车(bicycle)类、汽车(motorcar)类,从bicycle和motorcar派生出摩托车(motorcycle)类,它们都有Run、Stop等成员函数。观察虚函数的作用。
3. (选做)对实验2中的people类重载“= =”运算符和“=”运算符,“==”运算符判断两个people类对象的id属性是否相等;“=”运算符实现people对象的赋值操作
-1. Preparation process definition Point class defined in the class integer private member variables _x, _y, of the Point class overload "++"( increment) "--"( decrement) operator, to realize coordinates value changes.2. Write a program to define a car (vehicle) base class, with Run, Stop and other member functions, thus derived a bike (bicycle), automobiles (motorcar) class, derived from the bicycle and motorcar motorcycle (motorcycle) class, They all have Run, Stop and other member functions. Observe the role of virtual functions.3. (Elected to do) to Experiment 2 in the people category overloaded "= =" operator and "=" operator ,"==" operator to judge two people of the id attribute class object is equal "=" operator Fu realize people object assignment
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lab8/lab8_1.cpp
lab8/lab8_2.cpp
lab8/lab8_3.cpp
lab8
lab8/lab8_2.cpp
lab8/lab8_3.cpp
lab8
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.