Multi Level Inheritance
easyQuestion 134A three-level inheritance chain has been provided:
- Person (base class) with a protected name and getName() function
- Student (derived from Person)
- GraduateStudent (derived from Student)
Your task is to implement the printLevel() function for GraduateStudent. It should print "Graduate Student".
This demonstrates multi-level inheritance: GraduateStudent inherits from Student, which inherits from Person. The getName() function works because it is inherited through the entire chain.
Do NOT include a main function. Your code will be tested automatically.
Expected output
Carol Graduate Student
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
Inheritance
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.