Results 1 to 3 of 3
- 10-31-2011, 04:27 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 7
- Rep Power
- 0
I don't get what this is asking me to do...
I have an assignment out of my Java book and I'm not asking for anyone to code anything for me but I am asking if anyone can clarify what the book is trying to have me accomplish:
20. The following defines a function that calculates an approximation of the square root of a number, starting with an approximate answer(approx), within the specified tolerance(to1).
{approx | if|approx^2 - number| <= tol
sqrRoot(number,approx,tol) = {sqrRoot(number,(number^2 + number) / (2* approx), tol) | if|approx^2 - number | > tol
Write a recursive and non-recursive method of the sqrRoot method.
- 10-31-2011, 06:26 AM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Re: I don't get what this is asking me to do...
Are you sure you copied this code correctly? Please use proper indentation to make it easier for us to read. It looks like they want you to write two methods on calculating a method which finds the square root of some number.
- 10-31-2011, 08:19 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,400
- Blog Entries
- 7
- Rep Power
- 17


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks