CJCoding With Joseph

Square Inherits Width Property

The base class Shape2D defines a public auto-property Width. Square inherits from Shape2D. Complete ShowWidth() in Square so it prints the inherited Width property. Do NOT write a Main method.

When the tester sets Width to 7 and calls ShowWidth(), the program prints:
7

Expected Output:

7
Topics:
Inheritance
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.