Question: Polynomial class Using dynamic arrays, implement a polynomial class. The objects of this class should be able to grow to arbitrary size, and the class



Polynomial class Using dynamic arrays, implement a polynomial class. The objects of this class should be able to grow to arbitrary size, and the class should the following arithmetic operations on polynomials: addition, subtraction, and multiplication. The class should have methods to compare the order of two polynomials, and evaluate the polynomial at a given value. The class should also have overloaded []and output stream operators. Provide your solution in a separate header, implementation, and main.cpp files Discussion A polynomial (as shown below) can be completely specified by its coefficients and degree (the highest order term in the expression). Missing terms (ike the x term below) s have a simply coefficient of 0. For example the following cubic polynomial: 2x3 3x 4 Can be expressed fully as: 3x 4 And we see that we can represent the polynomial by storing its coefficients in an anray. [2034] Note that the term with degree 2 is missing, but we will use a coefficient of 0 to indicate that. Observe that the size of the coefficient array is 4, one more than the degree Your class should contain these private data members ll to keep track of the size of the polynomial int size double coef //to point to a dynamic array of coefficients of length (size) Your class should provide these member functions default constructor Copy constructor operator destructor parameterized constructor to create an arbitrary polynomial Should take an array as input for the coefficients
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
