Question: Task 5 Polynomial Class: [ 3 0 Marks ] Implement the following polynomial class:For example, a polynomial: 4 x 6 - 2 x 3 +
Task Polynomial Class: Marks
Implement the following polynomial class:For example, a polynomial: would be stored as:
coeffArray degreeArray terms
Make sure that the degree array is sorted in descending order so that the highest power
term appears first. Also, there should be no duplicates in the degree array and it should
only be allocated according to the total terms present in the polynomial.
Implement the following in MyPolynomial class
a Constructor, parametrized constructor, destructor and deep copy constructor.
b operator for the addition of two polynomials.
c operator for subtracting one polynomial from another.
d operator for multiplying two polynomials.
e assignment operator.
f comparison operator.
g operator.
h Input the polynomials using
i Print the polynomials using
j Pre increment all the coefficients of the polynomial using
k Pre decrement all the coefficients of the polynomial using
Post increment all exponents of the polynomial using
Post decrement all exponents of the polynomial using
Create a Menu to test all functionalities using switch statement.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
