public abstract class Shape
{
public virtual double ComputeCircumference()
{
return 0;
}
public virtual double ComputeArea()
{
return 0;
}
}
public class Rectangle : Shape
{
public double Width
{
get;
set;
}
public double Height
{
get;
set;
}
public override double ComputeCircumference()
{
return (this.Width + this.Height) * 2;
}
public virtual double ComputeArea()
{
return this.Width * this.Height;
}
}
public class Square : Shape
{
public double Width
{
get;
set;
}
public override double ComputeCircumference()
{
return this.Width * 4;
}
public virtual double ComputeArea()
{
return this.Width * this.Width;
}
}