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
Ariver flows from north to south at 8 km/h. a boat is to cross this river from west to east at a speed of 20 km/h (speed of the boat with respect to the earth/ground). at what angle (in degrees) must the boat be pointed upstream such that it will proceed directly across the river (hint: find the speed of the boat with respect to water/river)? a 288 b. 21.8 c. 326 d. 30.2
Answers: 3
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
question
Engineering, 04.07.2019 18:20
Avolume of 2.65 m3 of air in a rigid, insulated container fitted with a paddle wheel is initially at 264 k, 5.6 bar. the air receives 432 kj by work from the paddle wheel. assuming the ideal gas model with cv = 0.71 kj/kg • k, determine for the air the amount of entropy produced, in kj/k
Answers: 2
question
Engineering, 04.07.2019 18:20
Prove the equivalence between the two statements of the 2nd law of thermodynamics (i.e., a violation of one statement leads to the violatio the other statement)
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
Mathematics, 02.09.2020 22:01
question
English, 02.09.2020 22:01
Questions on the website: 13722367