But that doesn't show me how to form the equation. I'm still completely lost :/
I have to make it stop when it's equal to 0.005
and output all iterations.
Joined: Sep 21, 2011
John Morris wrote:But that doesn't show me how to form the equation.
You asked for a hint, you got a hint. It's your homework - hints is all you'll get.
You will need two variables for x, let's say x0 and x1. x0 would be the value calculated in the previous iteration, and x1 the value calculated in the current iteration. You want the loop to stop when abs(x0-x1) < 0.005.