Employee Engineer Inheritance
easyQuestion 138A base class Employee has been provided with protected members id (int) and name (string), a constructor, and a virtual print() function.
A derived class Engineer publicly inherits from Employee. It has no new attributes - it only changes how print() works.
Your task is to implement the overridden print() function for Engineer. It should print:
Engineer: [name]
Do NOT include a main function. Your code will be tested automatically.
Expected output
Engineer: Sara= 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.