CS 200 - Lab - 7
CS 200 - Lab - 7
Note: For this task, you can create as many classes, constructors, destructors, setters, getters, data
variables and class methods as you wish. Make sure that all your data members are private.
In this lab, you must implement a polynomial calculator to perform polynomial arithmetic (addition,
subtraction, multiplication). You would also be implementing input, output and evaluation of the
polynomials.
What is a polynomial?
A polynomial is a collection of terms. Each term has a coefficient and an exponent.
Example:
4 2
5𝑥 + 2𝑥 + 10
Some implementation hints:
You may implement your polynomial as a dynamic array of terms. Note that each term in the polynomial
must have a unique exponent (i.e. no two terms can have the same exponent).
Requirements:
1. You must name your polynomial class as Poly.
2. Comment on your main function before running the test file.
Assumptions:
1. The user will always input the polynomial in descending order. For example, if the user inputs
coefficient 5 and exponent 4 for the first term (which is 5x^4), you can assume the next term will
have an exponent of 3 or lower.