Write Program Java Implement Horner S Algorithm Words Program Evaluate Polynomial P X Anxn Q37127481

Write a program in Java to implement Horner’s algorithm. Inother words, your program should evaluate the polynomial p(x) =anxn + an-1 Xn-1 + … +a1x + a0 at a given point x.

Your program should prompt the user to enter the coefficients ofthe polynomial from the lowest degree to the highest degree and thenumber x. For example, to evaluate p(x) = 2×4 –x3 + 3×2 + x – 5 at x = 3, the user wouldinput: -5 1 3 -1 2 and 3. Your program should display thecoefficients of the polynomial and output the value of thepolynomial at x. For example,

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.