Solution: Create a Hierarchy of Inheritance

Look at the solution to the previous challenge.

Problem statement

Explore inheritance hierarchies by following these steps:

  1. Create a class named Shape with properties named Height, Width, and Area.

  2. Add three classes that derive from it: Rectangle, Square, and Circle with any additional members you feel are appropriate and that override and implement the Area property correctly.

  3. In Program.cs, add statements to create one instance of each shape, as shown in the following code:

Get hands-on with 1400+ tech skills courses.