Advertisement
calcpage

C6X13_NewtonRunner.java

Jan 20th, 2012
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.59 KB | None | 0 0
  1. /*
  2. NewtonRunner.java       MrG     2012.0119
  3. purpose:    solving equations of the form x^n-a=0
  4. required files: NewtonRunner.java       main class
  5.         Newton.java         derived class
  6. translator: javac NewtonRunner.java
  7. interpreter:    java NewtonRunner a n eps
  8. */
  9. public class NewtonRunner
  10. {
  11.     public static void main(String[] args)
  12.     {
  13.         double a = Double.parseDouble(args[0]);
  14.         int n = Integer.parseInt(args[1]);
  15.         double eps = Double.parseDouble(args[2]);
  16.  
  17.         Newton cody = new Newton(a,n,eps);
  18.  
  19.         do
  20.         {
  21.             System.out.println(cody.nextGuess());
  22.         }
  23.         while(cody.hasMoreGuesses());
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement