# Sample test data file for testpoly.c (Fall 2009, assignment 3) # Not necessarily the data file we will use to grade your assignment. # cmc, updated 10/22/09 # create first polygon, find stats and print added 5.1x^1 to poly 1 added 1.2x^2 to poly 1 added 17.3x^0 to poly 1 poly 1 value at 10 = 188.3 poly 1 degree = 2 poly 1 has 3 terms poly 1 = 1.2x^2 + 5.1x + 17.3 # create second polygon, find stats and print added 4.8x^2 to poly 2 added 2.25x^1 to poly 2 added -7.1x^0 to poly 2 poly 2 value at 10 = 495.4 poly 2 degree = 2 poly 2 has 3 terms poly 2 = 4.8x^2 + 2.25x - 7.1 # calculations sum(poly 1, poly 2) = 6x^2 + 7.35x + 10.2 mult(poly 1, poly 2) = 5.76x^4 + 27.18x^3 + 85.995x^2 + 2.715x - 122.83 diff(poly 1, poly 2) = -3.6x^2 + 2.85x + 24.4 diff(poly 2, poly 1) = 3.6x^2 - 2.85x - 24.4 diff(poly 2, poly 2) = 0 diff(poly 1, poly 1) = 0 # check clear, and operations associated with cleared polygon cleared poly 1 poly 1 degree = 0 poly 1 has 0 terms poly 1 = 0 sum(poly 1, poly 2) = 4.8x^2 + 2.25x - 7.1 mult(poly 1, poly 2) = 0 diff(poly 1, poly 2) = -4.8x^2 - 2.25x + 7.1 diff(poly 2, poly 1) = 4.8x^2 + 2.25x - 7.1 diff(poly 1, poly 1) = 0 Done. Created 50 terms. Freed 50 terms. All terms freed successfully.