文件名称:9
介绍说明--下载内容均来自于网络,请自行研究使用
多态性
声名一个学生类student,属性包括学号、姓名、性别、出生年月。由student类派生出大学生类和研究生类,大学生类的属性还包括班级、专业、系;研究生类的属性还包括研究方向、导师姓名。定义构造函数和析构函数以及数据成员的赋值和输出,在学生类中定义一虚函数(show())输出数据成员。
基本要求:实现动态调用派生类中相应函数;
高级要求:验证基类对象调用虚函数、指向基类对象的基类指针调用虚函数、派生类对象调用虚函数等情况。-Polymorphism of a student category known student, properties include the school number, name, sex, date of birth. Category derived from the student category of university students and postgraduate class, college students also includes the attributes of type Class, professional, system graduate attribute categories also include a study of the direction of instructors name. The definition of constructor and destructor, and data assignment and output members, students type in one virtual function defined in (show ()) output data members. Basic requirements: to achieve dynamic invocation of the corresponding derived class function Senior requirement: verify the base class object to call virtual function, point to base class object pointer to call the base class virtual functions, derived class object to call virtual functions and so on.
声名一个学生类student,属性包括学号、姓名、性别、出生年月。由student类派生出大学生类和研究生类,大学生类的属性还包括班级、专业、系;研究生类的属性还包括研究方向、导师姓名。定义构造函数和析构函数以及数据成员的赋值和输出,在学生类中定义一虚函数(show())输出数据成员。
基本要求:实现动态调用派生类中相应函数;
高级要求:验证基类对象调用虚函数、指向基类对象的基类指针调用虚函数、派生类对象调用虚函数等情况。-Polymorphism of a student category known student, properties include the school number, name, sex, date of birth. Category derived from the student category of university students and postgraduate class, college students also includes the attributes of type Class, professional, system graduate attribute categories also include a study of the direction of instructors name. The definition of constructor and destructor, and data assignment and output members, students type in one virtual function defined in (show ()) output data members. Basic requirements: to achieve dynamic invocation of the corresponding derived class function Senior requirement: verify the base class object to call virtual function, point to base class object pointer to call the base class virtual functions, derived class object to call virtual functions and so on.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
9.cpp