public static void Main()
shape triangle = new shape(3, "red");
Rectangle first = new Rectangle(4,"green",5,3);
Circle second = new Circle(1, "blue", 7);
Console.WriteLine(triangle.display());
Console.WriteLine(first.display());
Console.WriteLine(second.display());
public shape(int sides, string color)
return("This shape has " + sides+" sides and is the color "+ color);
internal class Rectangle: shape
public Rectangle(int sides,string color,int width,int length): base(sides,color)
public new string display()
return base.display() + ", has a width of " + width + " and a length of " +length;
internal class Circle: shape
public Circle(int sides,string color,int radius): base(sides,color)
public new string display()
return base.display() + " and has a radius of " + radius;