   import java.io.*;
   import java.util.Scanner;

/********************************************************************** 
 *   This class is designed to calculate the squareroot of a value
 *
 *
 *   author:  Dat Nguyen
 *   date:		1/22/2007
 *   lab4 
 *   section 2
 *
 **********************************************************************/
    public class IO_nguyendq_Rooter
   {
   /*********************************************************** 
    * This main method ask user to input a value and calculate
    * the square root of that value.
    *
    * @param args  array of string
    ***********************************************************/
       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 loop to let the user continue with different inputs
         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();
      }
    
   }
