import java.io.*;
import java.util.Scanner;
/***********************************************
 * Lab 3 - IO
 *
 * @author -Ben Hein
 * @version - V1 - Jan 22, 2007
 * Section: 1
 ************************************************/
 /*
 /  References and Ackknowledgements: I have recieved
 /  no help on this programming assignment
 /
 /***********************************************/


public class IO_heinbr_Rooter
{
/******
   This class finds the square root of a number inputted from the keyboard.
   
   ******/


    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();
		 
       //runs while there is still input from the keyboard
       while (keyboard.hasNext())
       {
          value = keyboard.nextDouble();
          result = Math.sqrt(value);//calculates square root

          screen.printf("The square root of " + value + " is " + result + "\n");
          screen.flush();
          
			 //asks for more input
          screen.println("Enter a number: ");       
        	 screen.flush();
       }

       screen.println("Done.\n");       
       screen.flush();
    }
    
}
