Purchase Solution

C++ - polynomials implementation

Not what you're looking for?

Ask Custom Question

Design and implement a class for dealing with polynomials. The polynomial
a(n)x^n + a(n-1)x^(n-1) + . . . + a0

will be implemented as a linked list. Each node will contain and int value for the power of x and an int value for the corresponding coefficient. The polynomial operations should include addition, multiplication, and evaluation of polynomials. Overload the operators + and *. Evaluation of a polynomial is implemented as a member function with one argument of type int.

Include four constructors: a default one, a copy constructor, a constructor with a single argument of type int that produces a polynomial that has only one constant term a0, and a constructor with two arguments of type int produces a polynomial whose coefficient and the exponent are given as parameters. Include a suitable destructor.

Include member functions to input and output polynomials. When the user inputs a polynomial, the user types in the following:
a(n)x^n + a(n-1)x^(n-1) + . . . + a0

For example, the polynomial -2x4 + 5x2 - 3 can be input as - 2x^4 + 5x^2 - 3 with spaces around each + or - sign. You can assume that polynomials are always entered one per line.

Purchase this Solution

Solution Summary

C++ polynomial implementations are examined.

Purchase this Solution


Free BrainMass Quizzes
Geometry - Real Life Application Problems

Understanding of how geometry applies to in real-world contexts

Multiplying Complex Numbers

This is a short quiz to check your understanding of multiplication of complex numbers in rectangular form.

Know Your Linear Equations

Each question is a choice-summary multiple choice question that will present you with a linear equation and then make 4 statements about that equation. You must determine which of the 4 statements are true (if any) in regards to the equation.

Exponential Expressions

In this quiz, you will have a chance to practice basic terminology of exponential expressions and how to evaluate them.

Graphs and Functions

This quiz helps you easily identify a function and test your understanding of ranges, domains , function inverses and transformations.