Advertisement
Guest User

Untitled

a guest
Nov 19th, 2012
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement