/*****************************************************************
** YDemoKeyboardInput, same as DemoKeyboardInput.java except
** using the York package
**
** The most dramatic changes in using the york package are in
** keyboard input.  Note the following changes from
** DemoKeybaordInput.java:
**
** a. The "throws IOException" clause is no longer necessary
** b. It is not necessary to instantiate a BufferedReader object
** c. Keyboard input is via York.readLine() instead of
**    stdin.readLine()
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import york.*;

public class YDemoKeyboardInput
{
   public static void main(String[] args)
   {
      // get input from the keyboard
      York.print("Please enter your name: ");
      String name = York.readLine();

      System.out.print("Please enter your age: ");
      String s1 = York.readLine();

      System.out.print("Please enter the radius of a circle: ");
      String s2 = York.readLine();

      // perform conversions on input strings
      int age = Integer.parseInt(s1);          // string to int
      double radius = Double.parseDouble(s2);  // string to double

      // operate on data
      age++;                                   // increment age
      double area = Math.PI * radius * radius; // compute circle area

      // output results
      York.println("Hello " + name);
      York.println("On your next birthday, you will be "
         + age + " years old");
      York.println("Area of circle is " + area);
   }
}

