Lab 12
CSC220: Programming II - Fall 2002
Due Date: Friday, December 6 (midnight)
Part One: Class Polynomial and PolynomialDemo (100 points)
Programming Problem 3.8 (page 169), Programming Problem 4.12 (page 240), and Programming Problem 11.3 (pg. 564)
Yep, just one class, but three different problems.
Each one builds off of the other.
This one involves designing your own methods. Be sure to provide the following
operations (among others):
- evaluate function at x
- add two polynomials
- subtract two polynomials
- multiply two polynomials
- (I wouldn't advise doing division - a bit trickier!)
- setting the coefficient (a_i)
- and of course the last part, finding a root via binary search (this method is worth 25 points)
- Make sure the class uses a linked list and has no maximum size for the degree k.
(this part is worth 25 points as well).
Write a simple interactive demo to illustrate the various methods and the polynomial class in general.