import java.io.PrintWriter;
import java.util.Scanner;
/******************************************
 * Finds the square root of an inputted number
 *
 * @author - Andrew Smith - modified from Adams
 * @date - 1/22/07
 ********************************************/

public class IO_smith3at_Rooter
{
    public static void main(String[] args)
    {
       double          value, result;
       PrintWriter     screen;
       Scanner         keyboard;

       screen   = new PrintWriter(System.out);
       keyboard = new Scanner(System.in);

       screen.println("Enter a number: ");
       screen.flush();

       //enter nothing
       while (keyboard.hasNext())
       {
          value = keyboard.nextDouble();
          result = Math.sqrt(value);

          screen.printf("The square root of " + value + " is " + result + "\n");
          screen.flush();

          screen.println("Enter a number: ");
        	 screen.flush();
       }

       screen.println("Done.\n");
       screen.flush();
    }

}
