← Back to Inheritance
Question 134
Multi Level Inheritance
Multi Level Inheritance
A three-level inheritance chain has been provided: - Person (base class) with a protected name andgetName()function - Student (derived from Person) - GraduateStudent (derived from Student) Your task is to implement theprintLevel()function for GraduateStudent. It should print "Graduate Student". This demonstrates multi-level inheritance: GraduateStudent inherits from Student, which inherits from Person. ThegetName()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 — 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.