Sorry 4 bothering you guys... its that im a beginner at this... they gave me a problem but I dont know how to interpret it, it says as follows:
The Babylonian algorithm to compute the square root of a number n is as follows.
(1) Make a guess, say g, at the answer (you can use n/2 for the initial guess).
(2) Compute r = n/g.
(3) Set g' = (g − r)/2. (g' is the guess for the next iteration)
(4) Go back to step 2 after setting g to the value of g'.
The more iterations of the loop you run, the closer you get to the square root of n.
Write a program that asks for a (double) number n and an (double) accuracy. Your
program is to loop until g2 is no more than accuracy away from n. Your program then
outputs g.
Hint Use more meaningful names than the one letter names above.
I just do not understand this, as I do not understand loops too well. Can any one of you "dummie" it down for me, you dont have to do me the excersise, just explain it a little easier, what do I hace to do, what does r, n & g exactly mean, how many times should I run the loop, what it is that I have to input.
If you can help me it would be appreciated :D