请使用VC6或使用[答题]菜单打开考生文件夹proj2下的工程proj2。此工程中定义了一个人员类Person,然后派生出学生类Student和教授类Professor。请在横线处填写适当的代码,然后删除横线,以实现上述类定义。此程序的正确输出结果应为: My name is Zhang. my name is Wang and my G.P.A.is 3.88. My name is Li, I have 8 publications.. 注意:只在横线处填写适当的代码,不要改动程序中的其他内容,也不要删除或移动“//********found********”。 #include <iostream> using namespace std; class Person{ public: //********** found********** ______{name =NULL;} Person (char* s) { name = new char[ strlen (s) +i]; strcpy(name, s); } ~Person() { if(name!=NULL) delete [] name; } //********** found********** ______Disp() //声明虚函数 { cout << "My name is" << name <<".\n"; } void setName (char* s) { name = new char[ strlen (s) +i]; strcpy (name, s); } protected: char* name; }; class Student : public Person{ public: //********** found********** Student (char * s, double g)______{} void Disp () { cout << "my name is" << name <<"andmy G.P.A. is" << gpa <<".\n"; } private: float gpa; }; class Professor : public Person{ public: void setPubls (int n) {publs =n;} void Disp () { cout << "My name is" <<name <<", Ihave" << publs <<" publications.\n"; } private: int publs; }; int main () { //********** found********** ______; Person x ("Zhang"); p = &x; p->Disp(); Student y("Wang", 3.88); p = &y; p->Disp(); Professor z; z. setName ("Li"); z. setPubls (8); p = &z; p->Disp(); return 0; }