Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment you are expected to develop a Polynomial Class template with which we can create polynomials with coefficients of any data type. Polynomials
In this assignment you are expected to develop a Polynomial Class template with which we can create polynomials with coefficients of any data type. Polynomials consist of terms as seen below and each term has a coefficient and exponent. The coefficient of the term 2x4 is 2 and its power is 4. anx" + an-1xn-1 + + a1x + ao ao, ...., an: coefficients n: degree of the polynomial (greatest exponent in the polynomial) We can store a polynomial as a string of terms. The Polynomial class template you will create will consist of the following components: 1. DATA MEMBERS: degree, coefficient array (you can take exponents as index, coefficients as elements.) For example, we can store the polynomial 2x3+4x+5 in the sequence below. 0 1 2 3 5 4 0 1 2. MEMBER FUNCTIONS: Constructor: Takes the degree of the polynomial as a parameter and creates a dynamic sequence. >> operator overloading function: reads the coefficients into the array. = operator overloading function: assigns a polynomial object to another object. a, b; cin >>a; cin >> b; cout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started