Please help! Super rusty with programming :(
A single variable polynomial is represented as an arithmetic expression shown below: A_0 + A_1 middot x + A_2 middot x^2 + ... + A_k middot x^k The highest exponent, k, is called the degree of the polynomial, and the constants A_0, A_1, ..., A_k are the coefficients. For example, here are two polynomials with degree 3: 2.1 + 4.8x + 0. 1x^2+ (-7.1)x^3 2.9 + 0.8x + + 1.7x^3 Design, and implement a class for polynomials. The class may contain a static member constant, MAX, which indicates the maximum degree of any polynomial (this allows you to store the coefficients in an array with a fixed size). The default constructor will be one which will initialize the polynomial with all coefficients set to zero. In addition, you must have another constructor that takes two parameters: degree, and coefficient_array which are used to initialize the polynomial appropriately. In addition you should have a member function that gets and sets the value of an appropriate coefficient. For example, get(k) returns the coefficient of x^k and set(k, 24.5) sets the coefficient of x^k to 24.5. You should provide a member function for evaluating a polynomial value for specific value of x, say x = 5.7. Please implement poly.cpp given the following poly.h header file: #ifndef POLY_H #define POLY_H class poly {public: static const int MAX = 10;//maximum degree is 9, maximum length of array is 10//CONSTRUCTORS poly();//a polynomial with degree 0 poly(const int k);//a polynomial with degree k poly(const int k, const double initial_coeff[]);//MEMBER FUNCTIONS void set(const int k, const double coeff);//sets the kth coefficient//CONSTANT MEMBER FUNCTIONS double get(const int k) const;//gets the kth coefficient int getdegree() const; double evaluate (const double xval) const;//evaluates the polynomial private: double data [MAX]; int degree;};} #endif