title: Rectangle class java with separate tester
body: <p>So my goal is to get a program working that has multiple methods to manipulate rectangles.So far most of my code works but when I use my tester I am getting errors.  Any insite would be most appreciated!
  First is my Tester Class.</p>
  
  <pre><code> public class MyTester {
  
  public static void main(String[] args) {
  
  
      Rectangle i = new Rectangle(5,8);
      Rectangle p = new Rectangle(8,5);
      Rectangle o = new Rectangle(4);
      Rectangle n = new Rectangle();
  
      System.out.println("---------------------------------------------------------------"); //line seperation per testers
  
      //this prints out the width and height to the user (2 arg construct)
      System.out.println("i width: " + i.getWidth() + "\n" + "i height: " + i.getHeight());
  
      System.out.println("---------------------------------------------------------------");
  
      //This prints out the width and height to the user (1 arg construct)
      System.out.println("o width: " + o.getWidth() + "\n" + "o height: " + o.getHeight());
  
      System.out.println("---------------------------------------------------------------");
  
      System.out.println("n width: " + n.getWidth() + "\n" + "n height: " + n.getHeight());
  
      System.out.println("---------------------------------------------------------------");
  
      System.out.println("Here is the duplicate d of rectangle duplicate: ");// rectangleDuplicate
      System.out.println("Fix this sections of the tester and code!");
  
      System.out.println("---------------------------------------------------------------");
  
      //This prints out to the user if Rectangles are equal or not
      System.out.println(i.equals(p));
  
      System.out.println("---------------------------------------------------------------");
  
      //This prints out to the user the new width and height after rotating
      System.out.println(i.rotate());
  
      System.out.println("---------------------------------------------------------------");
  
      //This prints out to the user the area of the selected rectangle
      System.out.println("The area of Rectangle o: " + o.getArea());
  
      System.out.println("---------------------------------------------------------------");
  
      //This prints out to the user the diagonal of the Rectangle selected
      System.out.println("The diagonal of Rectangle p: " + p.getDiagonal());
  
      System.out.println("---------------------------------------------------------------");
  
      System.out.println("A copy of Rectangle i: " + i.copy());//.copy
      System.out.println("Fix this sections of the tester and code!");
  
      System.out.println("---------------------------------------------------------------");
  
      System.out.println(p.scale());//.scale
      System.out.println("Fix this sections of the tester and code!");
  
      System.out.println("---------------------------------------------------------------");
  
      System.out.println("Lets double the area and pull the new width and height for Rectangle o: " + o.doubleIt());//.doubleIt
      System.out.println("Fix this sections of the tester and code!");
      }
  </code></pre>
  
  <p>}</p>
  
  <p>Second is my Rectangle Class</p>
  
  <pre><code> import java.util.*;
  </code></pre>
  
  <p>public class Rectangle {</p>
  
  <pre><code>//Data
  private double width;
  private double height;
  public Rectangle(double w, double h) {
      width = w;
      height = h;
  }
  
  
  
  //One no-arg constructor that constructs a rectangle 1X1
  public Rectangle() {
      width = 1.0;
      height = 1.0;
  }
  
  
  
  //One one-arg constructor that takes one double argument, and constructs a square that size
  public Rectangle(double sameSides) {
      width = sameSides;
      height = sameSides;
  }
  
  
  
  //One two-arg constructor that takes two double arguments, and constructs a rectangle that size
  //Getters and Setters
  public double getWidth() {
      return width;
  }
  public void setWidth(double width) {
      this.width = width;
  }
  public double getHeight() {
      return height;
  }
  public void setHeight(double height) {
      this.height = height;
  }
  
  
  
  //One one-arg constructor that takes a Rectangle as an argument, and constructs as new Rectangle of identical size
  public Rectangle(Rectangle rectangleDuplicate){ //calling rectangleDuplicate
      Rectangle d = new Rectangle();
      d.width = rectangleDuplicate.getWidth(); //set width to width of rectangleDuplicate
      d.height = rectangleDuplicate.getHeight(); //set height to height of rectangleDuplicate
  }
  
  
  
  
  
  //A ".equals()" method that accepts another Rectangle as argument, and returns TRUE if the other rectangle has an area within 1% of the instance rectangle.
  public boolean equals(Rectangle p){
      double areaTest = (this.getArea()) / (getArea());
      if (areaTest &lt;= 1.01 &amp;&amp; areaTest &gt;= 0.99){
          System.out.println("The area's are within 1% and thus are declared the same.");
          return true;
      }else{
          System.out.println("These two Rectangles are not the same.");
          return false;
      }
  }
  
  //A ".rotate()" method that reverses height and width of the instance rectangle.
  public boolean rotate(){
      double newWidth = height;
      double newHeight = width;
      System.out.println("The new width is: " + newWidth + "\n" + "The new height is: " + newHeight);
      return true;
  }
  
  
  
  
  //A .getArea()" method that returns the area of the rectangle.
  public double getArea() {
      double area = width * height;
      return area;
  }
  
  
  //A ".getDiagonal()" method that returns the diagonal of the rectangle.
  public double getDiagonal() {
      double diagonal = 0;
      diagonal = (width * width) + (height * height);
      diagonal = Math.sqrt(diagonal);
      return diagonal;
  }
  
  
  
  //A ".copy()" method that returns a rectangle of identical size.
  public void copy(){ 
      Rectangle rectangleCopy = new Rectangle(width,height);
      rectangleCopy.setWidth(width); //set width to width of rectangleCopy
      rectangleCopy.setHeight(height); //set height to height of rectangleCopy
  }
  
  
  
  //A ".scale()" method that accepts a single double argument, and scales the instance rectangle by that amount.  For example, a 4X3 rectangle with .scale(2.0) applied to it should become 8X6 in size.
  public void scale(){
      System.out.println("By what scale would you like to multiply?");
      Scanner scan = new Scanner(System.in);
      double scale = scan.nextDouble();
  
      width = width * scale;
      height = height * scale;
  }
  
  
  
  
  //A ".doubleIt()" method which should double the area of the rectangle, without changing its aspect ratio (the ratio between the height and width).
  public void doubleIt(){
      double area = getArea() * 2;
      height = area / (4*width);
      width = area / (4*((height) * (4*width / area)));        
  }
  </code></pre>
  
  <p>}</p>