Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The square root of a number N can be approximated by repeated calculation using the formula NG = 0.5(LG + N/LG) Where, NG stands for

The square root of a number N can be approximated by repeated calculation using the formula

NG = 0.5(LG + N/LG)

Where, NG stands for next guess and LG stands for last guess.

Write a function that calculates the square root of a number using this method. The initial guess will be the starting value of LG . The program will compute a value for NG using the formula given above. The difference between NG and LG is checked to see whether these two guesses are almost identical. If they are, NG is accepted as the square root; otherwise, the next guess ( NG ) becomes the last guess ( LG ) and the process is repeated (another value is computed for NG, the difference is checked, and so on). The loop should be repeated until the difference is less than 0.005. Using an initial guess of 1.0;

I WANT A SMALL AND LESS CODING THAT COVERS THE WHOLE INSTRUCTION RIGHT HERE FOR C++ . LESS AND SIMPLE CODING AS MUCH AS POSSIBLE!!! NOT THE LONG CODING !!!!!! AND I ALSO WANT THE PSEUDOCODE FOR THIS CODING IN A MOST SIMPLE AND UNDERSTANDABLE WAY!!!!!! I HOPE TO GET MY ANSWER AS SOON AS POSSIBLE!!!!!!!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

What advice would you provide to Jennifer?

Answered: 1 week ago

Question

What are the issues of concern for each of the affected parties?

Answered: 1 week ago