One of the methods to calculate the square root of a number is Newton’s method. The formula for Newton’s method is shown in Figure 2-15. Write the pseudocode for a recursive algorithm to compute a square root using Newton’s method. Verify your algorithm by using it to manually calculate the following test cases: square Root (5, 2, 0.01) and square Root (4, 2, 0.01). Note: in the formula, tol is an abbreviation for tolerance.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here