subject
Engineering, 10.11.2019 04:31 abbycrabby

The function sqrt from the header file can be used to find the square root of a nonnegative real number. using newton’s method, you can also write an algorithm to find the square root of a nonnegative real number within a given tolerance as follows: suppose x is a nonnegative real number, a is the approximate square root of x, and epsilon is the tolerance. start with a = x.
a. if |a2 - x| less or equal than epsilon, then a is the square root of x within the tolerance; otherwise:
b. replace a with (a2 + x) / (2a) and repeat step a in which |a2 - x| denotes the absolute value of a2 - x. write a recursive function to implement this algorithm to find the square root of a nonnegative real number. also, write a program to test your function.
turn in your source code file and one or more screen shots showing the results of your testing. after completing this project you will show that you can identify the base case(s) and general case in a recursive algorithm
utilize tail recursion in the construction of a recursive algorithm
construct a recursive algorithm that does not use global variables

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Carbon dioxide gas expands isotherm a turbine from 1 mpa, 500 k at 200 kpa. assuming the ideal gas model and neglecting the kinetic and potential energies, determine the change in entropy, heat transfer and work for each kilogram of co2.
Answers: 2
question
Engineering, 04.07.2019 18:10
True or false (explain) (110)[111] is a slip system in bcc metals . the {111} family in fcc contains 8 planes. resolved shear stress (rss) in single crystals is just related to the applied stress. critical resolved shear stress (crss) in single crystal metals is direct proportional to the number of defects in the structure
Answers: 2
question
Engineering, 04.07.2019 18:10
Compute the pressure drop of 30°c air flowing with a mean velocity of 8 m/s in a circular sheet-metal duct 300 mm in diameter and 15 m long. use a friction factor, f 0.02, and pair = 1.1644 kg/m a. 37.26 pa b. 25.27 pa n c. 29.34 pa d. 30.52 pa
Answers: 1
question
Engineering, 04.07.2019 18:20
Apiston-cylinder device contains 0.1 m3 of liquid water and 0.9 m3 of water vapor in equilibrium at 800 kpa. heat is transferred at constant pressure until the temperature of water reaches 350 °c. determine (a) the quality of water at the initial state (b) the work associated with this process, (c) the heat associated with this process.
Answers: 2
You know the right answer?
The function sqrt from the header file can be used to find the square root of a nonnegative real num...
Questions
question
Biology, 29.04.2021 22:50
question
Mathematics, 29.04.2021 22:50
question
Physics, 29.04.2021 22:50
Questions on the website: 13722367