As input, you are given an integer n, a double x, followed by n+1 doubles a_n, a_{n-1}, ..., a_0. You are to print the value of the polynomial a_0 + a_1x+a_2x^2+...+a_nx^n.
Here is the manual algorithm. At the beginning you just have read a_n. Next you read a_{n-1} and calculate a_nx+a_{n-1}. Next you read a_{n-2} and calculate (a_nx+a_{n-1})x+a_{n-2}. So after n iterations you will have the value of the polynomial above. Note that in each iteration you need to use the values calculated earlier.
Check that you understand the method by calculating manually for small values of n. This is not to be submitted, nor put in a program.
Write the program. You will need to decide what variables to use, what to store in them. Test your program as much as you can before submitting it.
1
Expert's answer
2020-02-12T11:36:59-0500
Dear gyytt89ip, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment