title: Calculating Rectangle Perimeter and Area
body: <p>We are supposed to make a program that creates a class with attributes length and width whose defaults are 1.0 and also has methods to get the perimeter and area. I'm done with creating the class but we have to test it out in a program. This is how my code looks like:</p>
  
  <pre><code>public class Rectangle {
  private double length, width;
  
  public Rectangle() {
      length = 1.0;
      width = 1.0;
  }
  public Rectangle (double l, double w){
      length = l;
      width = w;
  }
  public void setLength(double l){
      length = l;
  }
  public void setWidth(double w){
      width = w;
  }
  public double getLength(){
      return length;
  }
  public double getWidth(){
      return width;
  }
  public double getArea(){
      return length*width;
  }
  public double getPerimeter(){
      return (2*length)+(2*width);
  }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>import java.util.Scanner;
  public class TestRectangle {
  public static void main(String[]args) {
      int choice;
      double area, perimeter;     
      Scanner keyboard = new Scanner (System.in);
      Rectangle rec1 = new Rectangle();
  
      System.out.print("Choose an action:\n" + "1. Set Length\n" + "2. Set Width\n" + "3. Exit\n" + "Choice: ");
      choice = keyboard.nextInt();
  
      switch(choice){
          case 1:
              System.out.print("Enter Length: ");
              l = input.nextDouble;
              rec1.setLength(i);
              System.out.print("Length: "+rec1.getLength());
              System.out.print("Width: "+w);
              System.out.print("Area: "+rec1.getArea);
              System.out.print("Perimeter: "+rec1.getPerimeter);
              break;
          case 2:
              System.out.print("Enter Width: ");
              w = input.nextDouble;
              rec1.setWidth(w);
              System.out.print("Length: "+l);
              System.out.print("Width: "+rec1.getWidth);
              System.out.print("Area: "+rec1.getArea);
              System.out.print("Perimeter: "+rec1.getPerimeter);
              break;
          case 3:
              System.exit();
      }
  }
  }
  </code></pre>
  
  <p>It keeps on getting the error 'cannot find symbol.'</p>