IAssignment I

V22.102:Honors Data Structures
Spring 2000
Assignment III

Programming assignment: polynomial manipulation
Due: Wednesday Feb. 16

The purpose of this assignment is to implement a rudimentary symbolic
calculator to compute with polynomials. The program takes polynomials
in a single variable, of the form:
                                             2             n
                        P1 = a0 + a1.x + a2.x ..   + an.x

and performs algebraic operations on them. The coefficients ai are integers
(although this may change in the future). Internally, polynomials are
represented as lists of coefficients. Only non-zero coefficients are kept
in the internal representation, so that the 10th-degree polynomial
                          5 -10 x
has only two terms.

The program is interactive. It prompts the user for two polynomials. The input
for a given polynomial is a list of coefficients, in a single line, for example:
                            1 -2 0 0 15

The program echoes the input in some readable fashion, for example:

                            1 -2x + 15 x
and asks the user for confirmation (a simple Y/N aswer). After both
polynomials are entered, the program displays the sum and the product of both
polynomials, and asks for further input. The output is always presented in
order, lowest term first. Each term must have a distinct exponent.