public int CompareTo(IShape other) { if (other == null) { return(1); } if (Area.CompareTo(other.Area) == 0) { return(NumberOfSides.CompareTo(other.NumberOfSides)); } else { return(Area.CompareTo(other.Area)); } }