It's over for you. (if you can't do this)
You are given a base class box that defines a method foo() returning 0.
Implement a derived class whitebox that:
Overrides
foo()so that callingfoo()on awhiteboxinstance (even when it is referenced as abox) returns1instead of0;Overloads
foo()with a version that accepts a number and returns that number added by1.
You do not need to write any input/output parsing.
NOTE: The starter code is not necessarily complete. You are expected to edit it.
Example (cpp):
whitebox wb;
box& b = wb;
b.foo() // should return 1
b.foo(2) // should return 3
Accepted 4/19
Acceptance 21%
Loading editor...
Sample Input:
OVERRIDEExpected Output:
1