Question: Question 1: Implement a C++ program that determines the root of the following mathematical function: f(x) = 4x + 3x-5 The function asks the

Question 1: Implement a C++ program that determines the root of the

 

Question 1: Implement a C++ program that determines the root of the following mathematical function: f(x) = 4x + 3x-5 The function asks the user to provide an initial value xo (e.g., 4) for the root and a tolerance value (e.g., 0.00001). It then uses the Newton-Raphson method to iteratively find the root of the function. The program should provide the root value at the end along with the number of iterations it took the program to reach to the particular root. In case the number of iterations becomes more than 10,000, the program should exit by printing the message "number of iterations exceeded". Note: root is found by taking the derivative f'(x) of the function f(x) and then subtracting value of f(x) from x, x = f'(x) f(x) x- , iteratively until the result of the subtraction becomes less than the tolerance value provided by the user. f'(x) Set initial value of x as xo, as provided by the user. Question 2: Write a C++ program to determine the harmonic motion of a set of particles enter by the user. The harmonic motion is calculated by the following equation: h(t) = A cos(2f) where A is the amplitude of the particle motion, f'is the frequency, is the phase of the particle motion and is the time. 2 | Page Note: The user should provide the input about the total number of particles for which h(t) needs to be calculated. Then, the program should ask about 4, f, and a for each particle. The program should then ask about the start time, end time and the time interval to calculate h(t) for each particle and for each timeslot. (Hint: Consider solving the problem with a 2-D array).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!