Comp 212 Homework 2
Array Implementation of Polynomials

Due Friday Mar. 03, 2000 10:00 AM.

This homework exercise serves as an exercise on arrays.  It is based on the Polynomial example done in homework #1 and the addition of the visitor pattern to APolynomial as discussed in class.

Problem Statement

Examine the given design and documentation for an implementation of polynomials using array.  Reuse the code for APolynomial and all the visitors as discussed in class. 

  1. Write the code for PolyFactory and ArrayPoly as specified in the documentation.   You are free to add any number of private methods to ArrayPoly and PolyFactory, but do not change APolynomial.
  2. Rewrite the div and mod operation as visitors.  Feel free to make use of  the solution to homework #1.
  3. Write a client program to test your implementation and to illustrate that all existing visitors would run correctly unchanged.

Submission

The homework is due Friday March 03, 2000 at 10 AM.  It is to be submitted electronically.  Your labbies will give you specific submission instructions in the upcoming lab tutorial.  No late submission will be accepted.  The complete homework set should contain the following:


alc@cs.rice.edu  dxnguyen@cs.rice.edu         Please let us know of any broken links             Revised Feb. 28, 2000