To evaluate a nth degree polynomial for a given value of x using JAVA PRG.

Eg. 5x^7 + -2x^5 + 6x^3 + 1x^0 at x=2

The program must read in the number of non-zero terms in the polynomial followed by the co-efficient and power of each term. The value of x is read from the used and the program display the results of the evaluation of the polynomial. Use array list to represent the polynomial.

Test Case 1:

Input: No of terms: 4

Term n-1 to 0 (both coeffient and power )

5 7

-2 5

6 3

1 0

x = 2 (say)

Output :

625