public static void Main()
RectangleShape rect = new RectangleShape() {Height = 10, Width = 20};
Console.WriteLine("Rectangle Area: {0}", rect.Area());
OvalShape oval = new OvalShape(){Height = 10, Width = 10};
Console.WriteLine("Oval Area: {0}", oval.Area());
public class RectangleShape : IShape
public int Height{ get; set; }
public int Width { get; set; }
public class OvalShape : IShape
public int Height{ get; set; }
public int Width { get; set; }
return Math.PI * Width * Height;
public static class DrawScreen
public static void Draw(IShape shape)
Console.WriteLine("Drawing to screen Shape - Height: {0} Width: {1}", shape.Height, shape.Width);
public static class Print
public static void Draw(IShape shape)
Console.WriteLine("Printing to printer Shape - Height: {0} Width: {1}", shape.Height, shape.Width);