public static void Main()
shape [] Shapes = new shape[10];
for(int i = 0; i < 5; i++)
shape Circle = new circle();
for(int i = 5; i < 10; i++)
shape Rectangle = new rectangle();
foreach (shape shape in Shapes)
for(int i = 0; i < 10;i++)
public shape(string color, int opacity)
public virtual void Display()
Console.WriteLine($"This is a shape is {color} and its opacity is {opacity}%");
public virtual void perimeter()
Console.WriteLine("The specific shape is unkown, so we don't know the perimeter.");
public class circle : shape
public circle(int radius, int xCoord, int yCoord, string color, int opacity):base(color,opacity)
public override void Display()
Console.WriteLine($"This circle has a radius of {radius} and has its origin at ({xCoord},{yCoord})");
public override void perimeter()
Console.WriteLine($"The circumfrence is {3.141592653589793238462643383279502884197*radius*radius}");
public class rectangle : shape
public rectangle(int width, int length, string color, int opacity):base(color,opacity)
public override void Display()
Console.WriteLine($"This rectangle has a length of {length} and a width of {width}");
public override void perimeter()
Console.WriteLine($"The perimeter is {width*2+length*2}");