Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 19th, 2012  |  syntax: None  |  size: 0.65 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data