import java.io.PrintWriter;
import java.util.Scanner;
/*****************************************
* This class takes in a number from the user
* and returns the square root
*
* @author Modified by Geoff Wellington
* @version 2
*
* Geoff Wellington
* 01/22/07
* Section 2
******************************************/
public class IO_wellingm_Rooter
{
	/************************************
	* This is the main method
	* @param args unused
	************************************/
	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: "); 
		 //This is necessary to clear the buffer, otherwise nothing will be printed   
	    screen.flush();
		 
       
       while (keyboard.hasNext())
       {
          value = keyboard.nextDouble();
          result = Math.sqrt(value);

          screen.printf("The square root of " + value + " is " + result);
          screen.flush();
          
          screen.println("Enter a number: ");       
        	 screen.flush();
       }

       screen.println("Done.\n");       
       screen.flush();
    }
    
}
