// SquareRoots4.java - enter doubles // Math is a class that houses PI E SIN() COS() ... import tio.*; public class SquareRoots4 { public static void main(String[] args) { double square_root,fdbl; //either 10 roots or enter 0 System.out.println("Enter a double or 0:"); fdbl = Console.in.readDouble(); while (fdbl < 0.0) { System.out.println("Enter a double or 0:"); fdbl = Console.in.readDouble(); } square_root = Math.sqrt(fdbl); fdbl = (int)(1000 * square_root); System.out.println("the square root is " + fdbl/1000.0); System.out.println("That's All!"); } }