public Rectangle(double length, double width)
public double GetLength()
return this.width == this.length;
public double GetDiagonal()
return Math.Sqrt(this.length * this.length + this.width * this.width);
public void SetLength(double length)
public void SetWidth(double width)
return "Rectangle the Length is : " +
this.length + " the Width is : " +
public static void Main()
Rectangle r = new Rectangle(16.0,1.0);
Console.WriteLine(r.ToString());
if(r.IsSquare())Console.WriteLine(r.IsSquare());
else Console.WriteLine(r.IsSquare());
r.SetLength(r.GetLength()/4.0);
r.SetWidth(r.GetWidth()*4);
Console.WriteLine(r.ToString());
if(r.IsSquare()) Console.WriteLine(r.IsSquare());
else Console.WriteLine(r.IsSquare());