Question
Write a Python program that can store a polynomial such as p(x) = 12x10 + 9x7 x 10 as a list of terms. A term
Write a Python program that can store a polynomial such as p(x) = 12x10 + 9x7 x 10 as a list of terms. A term contains the coefficient and the power of x. For example, you would store p(x) as (12,10),(9,7),(1,1),(10,0) Supply functions to add, multiply, and print polynomials. Supply a function that makes a polynomial from a single term. For example, the polynomial p can be constructed as p = newPolynomial(-10, 0) addTerm(p, -1, 1) addTerm(p, 9, 7) addTerm(p, 12, 10) Then compute p(x) p(x). q = multiply(p, p) printPolynomial(q) Provide a module for the polynomial functions and import it into the driver module.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started