Uses this divide-and-average algorithm

Assignment Help Operating System
Reference no: EM13943693

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: EM13943693

Questions Cloud

Analysis of the company financial : Find or create their financials. Provide an analysis of the company's financial. With that information in mind, recommend a portfolio of investment instruments with specific names of each invest and explain why you are making the recommendations.
Young noted that you included an allowance : Your manager, Felix Young, wants to know why your estimate of the time it will take to get an MRP system up and running is so long.
What is the free cash flow to the firm : Eagle Products’ EBIT is $380, its tax rate is 30%, depreciation is $15, capital expenditures are $55, and the planned increase in net working capital is $26. What is the free cash flow to the firm?
Summary of the proposed marketing plan : Prepare a report that outlines: the pros and cons of this potential sponsorship agreement; the organisational/event fit; the marketing benefits with a concise summary of the proposed marketing plan;
Uses this divide-and-average algorithm : 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
The combustion of hydrogen and in the moisture : When burnt , the flue gas issuing out of the furnace at 545 oc analyses on dry basis as CO2 =14.5 % , O2 = 4.7%, N2 = 80.8 % , Other relevant data are- Gross C.V. of coal =28000 kj /kg , ambient temperature = 15oc
Assuming the stock market is efficient and the stocks : Stocks A and B have the following data. Assuming the stock market is efficient and the stocks are in equilibrium, which of the following statements is correct?
Create a reasonable doubt that the prosecution has proved : How can ignorance of facts and law create a reasonable doubt that the prosecution has proved the element of criminal intent? How does this relate to mens rea
Calculate the market capitalization rate : Miltmar Corporation will pay a year-end dividend of $5, and dividends thereafter are expected to grow at the constant rate of 4% per year. The risk-free rate is 4%, and the expected return on the market portfolio is 11%. The stock has a beta of 0.70...

Reviews

Write a Review

Operating System Questions & Answers

  Implementation of algorithms for process management

The Shortest Job Next (SJN) algorithm queues processes in a way that the ones that use the shortest CPU cycle will be selected for running rst.

  Develop a user mode command interpreter

Develop a user mode command interpreter which support list-short.

  Memory allocation in operating system

Analysis and implementation of algorithms for memory allocation in operating system, Explain First- t and best- t methods are used in memory allocation in operating systems.

  Stand alone child process

Forking the child process

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Marginal and average cost curves

n a competitive market place (pure competition) is it possible to continually sell your product at a price above the average cost of production.

  Simulating operating systems scheduling

Simulate the long-term scheduler, the short-term scheduler and the I/O scheduler of the computer using the First-Come-First-Serve algorithm.

  Issues with trusted platform module

Research paper discussing the issues with Trusted Platform Module (TPM)

  Threads

Explain a complication that concurrent processing adds to an operating system.

  Design and programming

Use the semaphore methods to control the concurrency of the solution

  Virtual machines

Virtual machines supported by a host operating system

  Discuss an application that benefits barrier synchronization

Discuss an application that would benefit from the use of barrier synchronization

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