/*
    ComputeArea3.java: This is a version of ComputeArea2.java
    that uses local variables inside of the "main" method instead
    of "static" variables inside of the ComputeArea3 class.
    (Variables that are declared static are really part of
    Object Oriented Programming, which we are not doing yet.)

    The file MyInput.java must be in the same directory as this file.
*/
//package Chapter2;

public class ComputeArea3
{
  /**
    Main method: Enter a value for radius and compute area of the circle
  */
  public static void main(String[] args)
  {
    // declare our variables as local variables
    double radius;
    double area;
    final double PI = 3.14159; // this is still a constant

    System.out.println("Enter radius");
    // Use a method from class MyInput to read in a double
    radius = MyInput.readDouble();
    area = radius*radius*PI;
    System.out.println("The area for the circle of radius " +
      radius + " is " + area);
  }//main
}//ComputeArea3

