← Back to Inheritance
Question 132
Overriding With Same Signature
Overriding With Same Signature
A base class Printer has been provided with a virtual functionprint()that is marked const and prints "Printing". A derived class ColorPrinter publicly inherits from Printer. Your task is to override theprint()function in ColorPrinter so that it prints "Color Printing". You MUST match the exact signature, including the const keyword, or the override will not work correctly. Do NOT include a main function. Your code will be tested automatically.
Expected Output:
Color Printing= 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.