update test 3

This commit is contained in:
Jidong Xiao
2025-04-11 05:04:40 -04:00
committed by JamesFlare1212
parent 235168710e
commit d8190eeea8

View File

@@ -24,6 +24,7 @@ class Student : public Human {
public: public:
Student(std::string n, int a, int s) : Human(n, a, s) {} Student(std::string n, int a, int s) : Human(n, a, s) {}
// note that the Student class never defines the name and age variables, but we can use them here, because of inheritance.
void introduce() { void introduce() {
std::cout << "Hello, I am " << name << ", and I am " << age << " years old. Im majoring in 'How did I get here?' with a minor in 'It sounded easier when I signed up.'\n"; std::cout << "Hello, I am " << name << ", and I am " << age << " years old. Im majoring in 'How did I get here?' with a minor in 'It sounded easier when I signed up.'\n";
} }