SHARE
TWEET

Untitled

a guest Nov 19th, 2012 29 Never
  1. import java.util.Scanner;
  2. public class RootsRunner
  3. {
  4.     public static void main(String[]ars)
  5.     {
  6.         Scanner in = new Scanner(System.in);
  7.         System.out.print("Enter a value for a. ");
  8.         String j = in.nextLine();
  9.         double a = Double.parseDouble(j);
  10.         System.out.println();
  11.         System.out.print("Enter a value for n. ");
  12.         String k = in.nextLine();
  13.         double n = Double.parseDouble(k);
  14.         final double EPSILON = .01;
  15.         Roots b = new Roots(a, n, EPSILON);
  16.        
  17.         while(b.hasMoreGuesses())
  18.         {
  19.             System.out.println(b.nextGuess());
  20.         }
  21.        
  22.        
  23.     }
  24. }
RAW Paste Data
Top