Jon,
Here is the solution to your problem. You were close, but needed a non-destructive ADD function. That got rid of the need to use the insert in the mult function (you just call mult and add recursively).

DeleteTerm allows for the next term in the Polynomial p to be examined(that was input by the user at the beginning of the program).

InsertTerm will be what is printed out to the screen at the end of the program. It is not part of main.cpp but poly.cpp...it looks like this:

void Polynomial::InsertTerm (float coeff, int deg)

// Precondition:
// A nonnegative degree deg and a coefficient coeff are assigned
// Postcondition:
// The polynomial contains a term of degree deg whose coefficient
// is coeff. If the polynomial originally had a term of degree deg
// then the coefficient of that term has been replaced. If coeff
// is zero the result is the same as DeleteTerm (deg).

DeleteTerm allows for the next term in the Polynomial p to be examined(that was input by the user at the beginning of the program).

InsertTerm will be what is printed out to the screen at the end of the program. It is not part of main.cpp but poly.cpp...it looks like this:

void Polynomial::InsertTerm (float coeff, int deg)

// Precondition:
// A nonnegative degree deg and a coefficient coeff are assigned
// Postcondition:
// The polynomial contains a term of degree deg whose coefficient
// is coeff. If the polynomial originally had a term of degree deg
// then the coefficient of that term has been replaced. If coeff
// is zero the result is the same as DeleteTerm (deg).

I did a little more work on the function, and came up with this. I am including AddPoly in hopes someone will understand more clearly what I am asking (keep getting seg fault for product of the Polys):

Jon,
Here is the solution to your problem. You were close, but needed a non-destructive ADD function. That got rid of the need to use the insert in the mult function (you just call mult and add recursively).

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity, I will suggest to accept

"BlackDiamond"

comment(s) as an answer.

If you think your question was not answered at all, you can explain here why you want to do this and post a request in Community support (please include this link) to refund your points. The link to the Community Support area is: http://www.experts-exchange.com/commspt/

Featured Post

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …

The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.