/*****************************************************************
** DemoKeyboardInput - demonstrate keyboard input
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.io.*;

public class DemoKeyboardInput
{
   public static void main(String[] args) throws IOException
   {
      // open keyboard for input (call it 'stdin')
      BufferedReader stdin =
         new BufferedReader(new InputStreamReader(System.in), 1);

      // get input from the keyboard
      System.out.print("Please enter your name: ");
      String name = stdin.readLine();

      System.out.print("Please enter your age: ");
      String s1 = stdin.readLine();

      System.out.print("Please enter the radius of a circle: ");
      String s2 = stdin.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
      System.out.println("Hello " + name);
      System.out.println("On your next birthday, you will be "
         + age + " years old");
      System.out.println("Area of circle is " + area);
   }
}

