
/**
 * Rooter
 *
/**
 *@authur Professor Elizabeth S. Adams
 * Yoshihiro Fujio
 * CS239 Section 2
 * Lab - Experimenting with File I/O
 * V1 2007/1/22
**/

import java.io.*; // imoprt io
import java.util.Scanner; // import Scanner

public class IO_fujioyx_Rooter
{
    public static void main(String[] args)
    {
       double          value, result;       
       PrintWriter     screen;       
       Scanner         keyboard;
       
       screen   = new PrintWriter(System.out);   // calling PrintWriter    
       keyboard = new Scanner(System.in);			 // calling Scanner

       screen.println("Enter a number: "); // doesn't show up with out flushing the stream
		 screen.flush();    // flush the stream
       
       
       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();
    }// end main
    
}// end class
