|
||||||||
Exercise: Creating a subclassnot turned in.The class Undergrad should contain:
You must also create a program called School which has a main() function that creates a few Undergrad and Graduate objects and after setting information prints outs this information to the screen. //now in Student.h file
class Student {
public:
char* Name;
int age;
int SSNum;
char* Advisor;
void PrintInfo();
}
//now in Student.cpp file
void Student::PrintInfo(){
cout << "Name: " << Name << endl;
cout << "age: " << age << endl;
cout << "SS#: " << SSNum << endl;
cout << "Advisor: " << Advisor << endl;
}
|
||||||||
| © Lynne Grewe |