static void Main(string[] _)
Shape[] shapeList = new Shape[2];
Circle circle1 = new Circle("blue", 5.4);
Rectangle rectangle1 = new Rectangle("red", 3, 2);
shapeList[1] = rectangle1;
public Shape(string color)
public string Color { get; set; }
public virtual void Display()
Console.WriteLine($"This shape has a {Color} color");
public virtual void areaCalc()
Console.WriteLine("Since there is no values for length or width, your area is assumed to be 0");
internal class Rectangle : Shape
public Rectangle(string color, int width, int length) : base(color)
public int Width { get; set; }
public int Length{ get; set; }
public override void Display()
Console.WriteLine($"Your rectangle has a {Color} color, a width of {Width} and a length of {Length}");
public override void areaCalc()
Console.WriteLine($"The area of your rectangle is {Width * Length}");
internal class Circle : Shape
public Circle(string color, double radius) : base(color)
double Radius { get; set; }
public override void Display()
Console.WriteLine($"Your circle has a {Color} color and a radius of {Radius}");
public override void areaCalc()
Console.WriteLine($"The area of your circle is {Radius*Math.PI}");