Question: Write a program that uses Newton's method to compute a squareroot. Objectives: Do-while looping Error cheek the user with a while loop if negative number

 Write a program that uses Newton's method to compute a squareroot.

Write a program that uses Newton's method to compute a squareroot. Objectives: Do-while looping Error cheek the user with a while loop if negative number entered Successful implementation of an algorithm Learn the fabs function Define a tolerance Sample Output: Enter a positive number: 3 Enter a guess: 1 squareroot: 1.73205 Newton's Method: Let x be the number entered by the user. Newton's method requires an initial guess y for the squareroot of x. In the example below, the guess is 1. Successive guesses are found by computing the average of y and x/y. The following table shows how the squareroot of 3 would be found: Note that the values of y get progressively closer to the true squareroot of x. For greater accuracy, your program should use variables of type double rather than float. Have the program terminate when the absolute value of the difference between the old value of y and the new value of y is less than .00001

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!