CJCoding With Joseph
15free / daySign inCreate account

Multi Level Inheritance

A 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 — print one after the last line.

Hints2 available
Topics:
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.