Design and implement a class for dealing with polynomials. The polynomial
a(n)x^n + a(n-1)x^(n-1) + . . . + a0
will be implemented as a linked list. Each node will contain and int value for the power of x and an int value for the corresponding coefficient. The polynomial operations should include addition, multiplication, and evaluation of polynomials. Overload the operators + and *. Evaluation of a polynomial is implemented as a member function with one argument of type int.
Include four constructors: a default one, a copy constructor, a constructor with a single argument of type int that produces a polynomial that has only one constant term a0, and a constructor with two arguments of type int produces a polynomial whose coefficient and the exponent are given as parameters. Include a suitable destructor.
For example, the polynomial -2x4 + 5x2 - 3 can be input as - 2x^4 + 5x^2 - 3 with spaces around each + or - sign. You can assume that polynomials are always entered one per line.© BrainMass Inc. brainmass.com October 25, 2018, 12:54 am ad1c9bdddf
C++ polynomial implementations are examined.
Do this exercise in C++ language, prefer use Visual C++ or DevC to compile.
Exercise 6.3: A polynomial of degree n has the form
Where are numeric constants called the coefficients of the polynomial and #0.
is a polynomial of degree 4 with integer coefficients 1, 3, 0, -7 and 5. One common implementation of a polynomial stores the degree of the polynomial and the list of coefficients. This is the implementation to be used in the exercises that follow. As you add the various operations to the Polynomial class you are building, you should also write a program to test your class.
1. Write a declaration for a Polynomial class whose data members are an integer for the degree and an array for the list of coefficients and with basic operations of input and output.
2. Implement the input operation in Question 1
3. Implement the output operation in Question 1. Display the polynomial in the usual mathematical format with displayed as x^n.
4. Add an evaluate operation to your Polynomial class that allows the user to enter a value for x and that calculates the value of the polynomial for that value.
5. Add an addition operation to your Polynomial class.
6. Add a multiplication operation to you Polynomial class.