โ Back to Inheritance
Question 128
Calling Base Using Scope Resolution
Calling Base Using Scope Resolution
A base class Employee has been provided with a protected string name, a constructor, and a virtual function print() that prints the name. A derived class Manager publicly inherits from Employee. The print() function has been declared in Manager with the override keyword. Your task is to implement Manager::print() so that it: 1. First calls the base class version Employee::print() 2. Then prints "Manager" on a new line Do NOT include a main function. Your code will be tested automatically. Expected output: Bob Manager
Expected Output:
Bob Manager
Topics:
Inheritance
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.