jGuru Forums

java programming
1 posts in topic
Flat View
TOPIC ACTIONS:

Posted By:   becky_mason
Posted On:   Wednesday, March 19, 2003 09:43 AM

Hi everyone! im a complete java beginner and stuck trying to write some java programmes. Please can anybody help me? the questions are..... 1)'The Heron method is a method for computing square roots that was known to the ancient Greeks.If x is a guess for the value of the squareroot of a , then the average of x and a/x ia a better guess. Implement a class RoorApproximator that starts with an initial guess of 1 and whose nextGuess method produces a sequence of increasingly better guesses.Supply a method hasmoreGuesses that returns 'false' if two successive guesses are sufficiently close to eaach other. Then test your class like this: Rootapproximator r = new RootApproximator(n); while (r.hasMoreGuesses())    More>>

Hi everyone!
im a complete java beginner and stuck trying to write some java programmes.
the questions are.....

1)'The Heron method is a method for computing square roots that was known to the ancient Greeks.If x is a guess for the value of the squareroot of a , then the average of x and a/x ia a better guess.
Implement a class RoorApproximator that starts with an initial guess of 1 and whose nextGuess method produces a sequence of increasingly better guesses.Supply a method hasmoreGuesses that returns 'false' if two successive guesses are sufficiently close to eaach other. Then test your class like this:
Rootapproximator r = new RootApproximator(n);
while (r.hasMoreGuesses())
System.out.println(r.nextGuess()); '

2) Write a java programme that computes e^x using the power series - e^x = sum from 0 to infinity of (X^n / n!).

I reckon anyone who knows java will understand my problems as a complete beginner lol. So if anyone could help me with this programme it would be much appreciated....
Thanks everyone
x

<<Less

Re: java programming

Posted By:   Anonymous
Posted On:   Wednesday, March 19, 2003 10:09 AM

If you have intelligent and specific questions about Java, feel free to post them and surely someone will help you. However, no one will do your homework for you...