Hello all,
I hope I find the help I need here. I am sorry I am not good enough in C++ yet. This is my first year so please be patient with me.
This is my problem:
p = 4x^5 + 7x^3 - x^2 +9
the ADT operations are:
p.degree() is 5 ( the highest power of a term with a nonzero coefficient )
p.coefficient (3) is 7 ( the coefficient of the x^3 term )
p.coefficient (4) is 0 ( the coeffient of a missing term is implicitly 0 )
p.ChangeCoefficient (-3, 7) produces the polynomial
p = -3x^7 + 4x^5 + 7x^3 - x^2 +9
so the question is : Using these ADT operations, write statements to perform the following tasks:
a. Display the coefficient of the term that has the highest power.
b. Increase the coefficient of the x^3 term by 8.
c. Compute the sum of two polynomials.
My answers so far:
a.
cout<< "The coefficient of the term that has the highest power is: " << p.degree();
b.
cout<< "The new coefficient of x^3 is: " << p.changeCoefficient(7+8, 3);
c. I couldn't get this one. I am a little bit confused.
Thanks for your help in advance