Question: Using Java Implement the following Programing Problem: A polynomial of a single variable x with integer coefficients is an expression of the form p(x)=c0 +c1x+c2x2
Using Java
Implement the following Programing Problem: A polynomial of a single variable x with integer coefficients is an expression of the form
p(x)=c0 +c1x+c2x2 +c3x3 +...+cnxn (1) where ci i = 0, 1, . . . , n, are integers. Create a class for polynomials up to the nth degree. Use
this class to implement a calculator of polynomials, which has the following menu:
POLYNOMIAL CALCULATOR
a) POLYNOMIAL EVALUATION b) POLYNOMIAL DERIVATIVE c) EXIT
Enter the index for the task you want to perform:
After the choice is entered, ask the user for the degree of the polynomila he/she wants to create. Then ask for their coefficients and the value at which the polynomial would be evaluated. A sample output for choice a) would be:
Your polynomial is p(x) = 2x^4 - x^2 + 3x - 5
p(2.5) = 74.375
A sample output for choice b) would be:
Your polynomial is p(x) = 2x^4 - x^2 + 3x - 5 The derivative of p(x) is p(x) = 8x^3 - 2x + 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
