Check05D - final double THREE = 3 final double TOLERANCE =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Scanner; import java.io.PrintStream; i public class Check05D { public static void main(String[] args) { PrintStream output = System.out; Scanner input = new Scanner(System.in); output.print("Enter any real number . .. "); double a = input.nextDouble(), xNew = a, xOld;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: final double THREE = 3; final double TOLERANCE = 0.0010; do { xOld = xNew; xNew = xNew - (Math.pow(xNew, THREE) - a) / (THREE * Math.pow(xNew, 2)); } while (Math.abs(xOld - xNew) > TOLERANCE); output.printf("Within 0.0010 the limit is: %.4f%n", xNew); } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online