Question: Task 5 Polynomial Class: [ 3 0 Marks ] Implement the following polynomial class:For example, a polynomial: 4 x 6 - 2 x 3 +

Task 5 Polynomial Class: [30 Marks]
Implement the following polynomial class:For example, a polynomial: 4x6-2x3+6x2+1 would be stored as:
coeffArray =[4-26], degreeArray =[632], terms =4
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 ++.
m Post decrement all exponents of the polynomial using --.
Create a Menu to test all functionalities using switch statement.
 Task 5 Polynomial Class: [30 Marks] Implement the following polynomial class:For

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!