Question: C++ please write me a code and make sure its variable and argument are easy to read becaue im new to this program. we just

C++
please write me a code and make sure its variable and argument are easy to read becaue im new to this program. we just started the program. also we are only jn chapter 3 so please use variabels that i could understand
 C++please write me a code and make sure its variable and
A sample run
argument are easy to read becaue im new to this program. we

5. Given a positive real number n, and an approximation for its square root, approx, a closer approximation to the actual square root, new-approx, can be obtained using the formula: new-approx=2approxn+approx Using this information, write a program that prompts the user for a positive number and an initial approximation to the square root of the number, and then approximates the actual square root of the number accurate to 0.00001. Hint: Using the initial approximation as the first value of approx, repeatedly calculate a new-approx, using the above formula, until the absolute value of the difference between the new-approx and approx is less than or equal to 0.00001. If the difference is greater than 0.00001, then calculate another new-approx, using its previous value as the value of approx. Note: The function fabs should be used to calculate the needed absolute value. To find the absolute value of a variable x, include this code: f abs (x) Note: To use this function, you need to add \#include cmath after the other include statement at the beginning of your code. Enter n: 5 Enter first approximation: 2 The square root of 5=2.23607

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!