2. Develop and debug a function or program to calculate the square root of a positive number a in either a high-level language or a macro language (VBA) of your choice using the "divide and average...


2. Develop and debug a function or program to calculate the square<br>root of a positive number a in either a high-level language or a macro<br>language (VBA) of your choice using the

Extracted text: 2. Develop and debug a function or program to calculate the square root of a positive number a in either a high-level language or a macro language (VBA) of your choice using the "divide and average method", i.e., a sqroot + sqroot sqroot = 2 where sqroot is the approximate value of the square of a. Initialize the value of sqroot to be one-half of a. Use iteration method by applying the formula above. The iteration stops when the approximate percent relative error is less than a pre-specified value ɛ,. The output must include: - the number of iterations, - the approximate percent relative error of the last iteration &, and - the square root of a. Sample Output using a = 2405, ɛ, = 0.001: Iterations: 9, Ea: 1.68919494599801E-07, Square Root of 2405 = 49.0407993409569

Jun 02, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here