import java.io.PrintWriter;
import java.util.Scanner;
/******************************************
 * David Wayne Moore II
 * 1/22/07
 * Section 1
 * Lab 4
 ******************************************/
 
// class name 
public class IO_mooredw_Rooter
{

/******************************************
 * This method takes in a number and finds its
 * square root
 ******************************************/

	// method header for the main method 
    public static void main(String[] args)
    {
       double          value, result; // numbers that are inputed and calculated    
       PrintWriter     screen; //Declaration of screen as PrintWriter object
       Scanner         keyboard; // Declarartion of keyboard as Scanner object	    
		 
       screen   = new PrintWriter(System.out); // Instantiation of screen object     
       keyboard = new Scanner(System.in); // Instantiation of keyboard object
		 date = new File[args[0]];

       screen.println("Enter a number: "); // Prompts user to inpute a number   
		 screen.flush(); 
       
       // while loop that take in following iterations
       while (keyboard.hasNext())
       {
          value = keyboard.nextDouble(); // value is being assigned number inputed by user
          result = Math.sqrt(value); // result is being assigned square root of value
			
			// Print out of square root of variable value 
          screen.printf("The square root of " + value + " is " + result);
          screen.flush();
          
          screen.println("Enter a number: "); // Prompts user to enter a number again    
        	 screen.flush(); // Flushes the output stream
       }

       screen.println("Done.\n"); // Prints out message that the program is done    
       screen.flush(); // Flushes the output stream
    }
    
}
