C++ problem
please explain with comments why (Please do not use C)
Description of the Secant Method: The Newton-Raphson method is an extremely powerful approach to solve numerically single variable non-linear equation, but it has a major weakness: the need to know the value of the derivative of the function f(x) at each approximation of x. Frequently, f'(x) is far more difficult and needs more arithmetic operations to calculate than f(x). To circumvent the problem, a slight modification to NR is introduced known as the Secant method. The successive approximations of x by the NR method is Xn+1 = xn + -f(xn) f'(xn) The modification to successive approximations of x in the secant method is Xn+1 = xn + -f(xn)(xn – Xn-1) f(xn) - f(xn-1) The secant method needs to start with two initial guesses namely X1 and Xo, and then compute X2. Error is computed using the same formula as was used for the NR method. Note: In the secant method, only one function value needs to be computed per step after the initial step.
Problem 3 Points: 7 Write a program that allows the user to choose the size of a vector (up to 10 elements) and allows them to input integers as the elements. Sort the array in ascending order and compute the mean and standard deviation. You may not use a predefined sort function - you must develop your own algorithm. Display the sorted array, and the mean and the standard deviation of the array.
C++ problem please explain with comments why (Please do not use C)
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am