import java.util.Scanner;
import java.io.PrintWriter;
/***********************************************
 * Print square root of input numbers.
 *
 * @author - Ryan Tighe
 * @version - V1 - January 22, 2007
 * 2:30 - 3:20 PM
 * Lab 4
 ************************************************/

public class IO_tigherj_Rooter
{
  /**************************************************
	 * Main Method will run through to print out the
	 *	square root of an input number
	 *
	 *	@param	Command line arguments unused in this program
	 **************************************************/  
	 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();
       
       //will continue until no more numbers
       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();
    }
    
}
