Define the divide-and-average algorithm

Assignment Help Computer Engineering
Reference no: EM1328423

The divide-and-average algorithm for approximating the square root of any positive number a is as follows: Take any initial approximation x that is positive, and then find a new approximation by calculating the average of x and a/x, that is, (x + a/x)/2. Repeat this procedure with x replaced by this new approximation, stopping when x and a/x differ in absolute value by some specified error allowance, such as 0.00001. Write a program that reads values for x, a, and the small error allowance and then uses this divide-and-average algorithm to find the approximate square root of x. Execute the program with a=3 and error allowance=0.00001, and use the following initial approximationa: 1, 10, 0.01, and 100. Also execute the program with a=4, errow allowance=0.00001, and initial approximations 1 and 2.

Reference no: EM1328423

Questions Cloud

Description of present value and future value : The shorter the length of time between present value and its corresponding future value, the lower present value, relative to future value, true of false?
Evaluate the on-going progress of the change effort : The solution thoroughly addresses each question, utilizing a call center work environment as example. Included are potential  measurements, both quantitative and qualitative, for measuring change efforts with these job duties.
What do you meant by operations management : What do you meant by operations management? Why is it important? Is a good knowledge of operations management more important in service or manufacturing industries? Explain your answer.
Motive carry greater weight on ethical scales : Should motive or conduct carry greater weight on the ethical scales in this situation?
Define the divide-and-average algorithm : The divide-and-average algorithm for approximating the square root of any positive number a is as follows: Take any initial approximation x that is positive, and then find out a new approximation by calculating the average of x and a/x, that is, (..
Assistance on supply chain management paper : Requesting assistance on Supply Chain Management Paper - Background: elucidate the current situation and context - tell about the campaign and what it was supposed to do and why you were assigned and Strategy
Determining present value and future value : You have just received a windfall from an investment you made in a friend's business. What is the present value of your windfall? What is the future value of your windfall in three years (on the date of the last payment)?
About the equitably toll : An attorney failed to file his client's EEO case within the 90-day required period.
Assume that the price elasticity of demand for good : Assume that the price elasticity of demand for good. Describe how much consumption changes.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How to use a nested select case statement

plan and build an application that works as a paper, scissors, and rock game. Draw a flowchart and write pseudocode before coding the application. Use two ComboBox controls to input the selections of the two players and label the ComboBox controls..

  What factors in computer design would affect the decision

What factors in computer design would affect the decision.

  What is the test plan

What information should be included in the comments at the top of a program? What is a test plan? I am looking for general reply not specific to this or any other program.

  Write down a program to solve linear system

Write down a program to solve linear system

  Protecting against the attack

Major corporations, governments, and the other organizations are hacked every week, mostly by the means of phishing the attacks. Explain how users and IT organizations must arm themselves against these attacks.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

  Resolving the ambiguities in the software

Describe what you must do in such a situation. You know that cost to your current employer will increase in case the ambiguities are not resolved. Though, you have also a responsibility of confidentiality to your previous employer.

  Distinguish between open and closed applications.

explain  HTML, XML and Java programming. What is the difference between the three.

  Explain why 802.11b is the first popular standard

the first widely popular standard and still by far most used by IT industry today.

  What changes have to be made to accept $ and cents

What changes have to be made to accept $ and cents

  What are the strengths and weaknesses

Explain the difference between managing users in the workgroup environment versus in a domain environment.

  Plan the decision table with all possibilities

Plan the decision table with all possibilities

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd