源码简介: |
1.编写程序,对实验13中的老师类增加上课方法;2.编写程序,对实验13中的学生类增加上课方法;3.编写程序,把老师类和学生类的上课方法抽象到人类中成为虚函数:4.编写程序,用父类指针来实现动态多态的调用;5.编写程序,抽象一个上课的抽象类,此类只有一个上课的纯虚成员函数,然后将上课方法从人类中剥离出去,然后让老师类和学生类都同时继承人类和上课抽象类,并修改相关代码;并思考这样做的好处;-1. Write a program, the experimental teacher class adding method of 13 2. Write a program to 13 students in the experimental class adding method 3. Write a program, the teachers and students class methods abstract class to become a virtual function in humans:4. Write a program, a parent class pointer is used to realize dynamic polymorphism calling 5. Write a program to abstract a abstract class in class, this is only a pure virtual class member functions, and then spun off from humanity class methods, and then let the teachers and students class inherits both the human and the abstract class, in class and modify the relevant code And think about the benefits
|