Page 1 of 1

C++ question. I am a little stuck. Thank you for the help, I will upvote Problem: Consider the ADT polynomial -- in a si

Posted: Mon Mar 21, 2022 4:39 pm
by answerhappygod
C Question I Am A Little Stuck Thank You For The Help I Will Upvote Problem Consider The Adt Polynomial In A Si 1
C Question I Am A Little Stuck Thank You For The Help I Will Upvote Problem Consider The Adt Polynomial In A Si 1 (94.91 KiB) Viewed 51 times
C++ question. I am a little stuck. Thank you for the help, I will upvote Problem: Consider the ADT polynomial -- in a single variable x -- whose operations include the following: degree() // returns the degree of the polynomial coefficient(power) // returns the coefficient of the xpower term. changeCoefficient(newCoefficient, power) // replaces the coefficient of the xpower term with newCoefficient. For this problem, consider only polynomials whose exponents are nonnegative integers. For example, p = 4x5 + 7x3 - x2 + 9 The following examples demonstrate the ADT operations on this polynomial. - p.degree() is 5 (the highest power of a term with a nonzero coefficient) -p.coefficient(3) is 7 (the coefficient of the x3 term) -p.coefficient(4) is 0 (the coefficient of a missing term is implicitly 0) - p.changeCoefficient(-3, 7) changes the polynomial p to -3x7 + 4x5 + 7x3 - x2 + 9 Question: Using these ADT operations: a) Increase the coefficient of the x term by 8 b) Compute the sum of two polynomials.