Replace the TERM macro with an equivalent function.
Write a function that will add two polynomials together and assign the result to a third polynomial.
Replace the code that prints the answer in poly.c with an equivalent function that will print "any" polynomial. Test your program as follows:
- create and initialize the following polynomials:
p1 = 3x4 + 2x3+x2+2X+1
p2 = 3x9 + 2x3+1
p3 = 3x6 +1
- Use your add function to add the following polynomials together:
p4 = p1 + p2
p5 = p3 + p4
- Use your print function to print out all polynomials
Make sure that all of your code is documented; each function should have a set of header comments that includes:
- the name of the function
- it's inputs and outputs
- a description of what the function does and how to use it.
The program should also contain a block of comments that includes:
- a description of the overall program
- the Lab number
- the course number and your lab section number
- your name.
Make sure that you create a README file to explaing any idiosyncracies of your program to the TA.
Once you have submitted your lab to the server send a note to your TA that it is ready for grading.
Last updated: 02/14/2010 - RVS