Code for class is not compiling, I'm lost.
public class RectangleClass
{
private double length = 1.0;
private double width = 1.0;
private double perimeter = 0.0;
private double area = 0.0;
public void setLength(double length)
{
if (length > 0.0 && length < 20.0)
{
this.length = length;
}
}
public void setWidth( double width)
{
if ( width > 0.0 && width < 20.0)
{
this.width = width;
}
}
public double getLength()
{
return this.length;
}
public double getWidth()
{
return this.width;
}
public double calcPerimeter()
{
perimeter = ((2 * length) + (2* width));
}
public double calcArea()
{
area = length * width;
}
public String toString(double length, double width, double perimeter, double area)
{
return String.format(System.out.print("length: %d", length\n "width: %d", width\n "perimeter: %d", perimeter\n
"area: %d", area\n));
}
}