What is .00000000000001 in scientific notation?

A good answer might be:

1.0E-14

Skeleton Square Root Program

Here is a skeleton of the program, with the loop condition translated from math into Java. The absolute value of a double is calculated by Math.abs( double ).

class  squareRoot
{

  public static void main( String[] args ) 
  {
    final double smallValue = 1.0E-14 ;
    double N     = 3.00 ;
    double guess = 1.00 ;

    while ( Math.abs( N/(guess*guess) - 1.0 ) > smallValue )
    {

       // calculate a new value for the guess
       
       
    }

    System.out.println("The square root of " + N + " is " + guess ) ;
  }

}

Remember the formula for updating the guess:

newGuess = N/(2*oldGuess) + oldGuess/2

Remember that: in an assignment statement, the variable on the left of the "=" is updated by giving it the value that is calculated on the right. This allows you to complete the program using just one variable, guess.

QUESTION 14:

Complete the program by filling in the loop body. You should be able to type in your answer into the text area. (But to run the program you will have to copy and paste to Notepad.)