//Program to calculate the square root of a number using the Newton-Raphson.
//It stops when the difference between consecutive approximations is less than 0.00005
//Uses an interface.
//by Neil Broadbent

import java.io.IOException;
import NeilClass.*;
import NewtonRaphsonClass.*;

public class NewtonRaphson
{
   public static void main(String[] pArgs) throws IOException
   {
       double tValue = NeilClass.GetInputDouble("Type in a number ");
       final NewtonInterface tNewton = new NewtonRaphsonClass(tValue);
       double sr = tNewton.getNewton();
       System.out.println("The Calculated Square root is    " + sr);
       System.out.println("The value from java.math.lang is " + Math.sqrt(tValue));
    }
 }

