It's over for you. (if you can't do this)

Exclusive Easy 1.5 Basics Millennium

You are given a base class box that defines a method foo() returning 0.

Implement a derived class whitebox that:

  • Overrides foo() so that calling foo() on a whitebox instance (even when it is referenced as a box) returns 1 instead of 0;

  • Overloads foo() with a version that accepts a number and returns that number added by 1.

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:
OVERRIDE
Expected Output:
1