import java.io.*;
import java.util.Scanner;
/***********************************************
 * This class will take in a number and 
 *	generate the sqare root of the number.
 *
 *
 * @author -E. Adams modified by Danny Ziemer
 * @version - V1 - 1/22/2007
 * Lab4 
 * Section - 1
 **********************************************/

public class IO_ziemerdp_Rooter
{
/********************************************
* This method takes in a number entered by 
* the user and using the math class creates the
* square root of that number.
*
*********************************************/
    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();
       
       while (keyboard.hasNext())//loops to find more inputs
       {
          value = keyboard.nextDouble();
          result = Math.sqrt(value);//generates the squareroot of the number

          screen.printf("The square root of " + value + " is " + result);
          screen.flush();
          
          screen.println("Enter a number: ");       
        	 screen.flush();
       }

       screen.println("Done.\n");       
       screen.flush();
    }
    
}
