public string OutputAsHTML(IShape shape) { return($"<p>Area : {shape.CalculateArea()}</p><br /><p>Perimeter : {shape.CalculatePerimeter()}</p>"); }
public string OutputAsJSON(IShape shape) { return($"{{ \"Area\" : {shape.CalculateArea()}, \"Perimeter\" : {shape.CalculatePerimeter()} }}"); }
public int CompareTo(IShape other) { var perimeterCheck = Math.Round(this.CalculatePerimeter(), 2).CompareTo(Math.Round(other.CalculatePerimeter(), 2)); return(perimeterCheck == 0 ? Math.Round(this.CalculateSurface(), 2).CompareTo(Math.Round(other.CalculateSurface(), 2)) : perimeterCheck); }