-2

I have to make a program using a console menu that reads "m" polynomials with integer coefficients and shows the pairs that have at least one common root, showing for each pair the common roots.I have to make a method that checks if two polynomials have common roots and stores them, a subalgorythm that reads a polynomial by its grade and its coefficients or by its monomial.

  • Welcome to Stack Overflow. Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Then check the [help/on-topic] to see what questions you can ask. Please see: [How do I ask and answer homework questions?](https://meta.stackoverflow.com/q/334822) – Progman Oct 28 '20 at 11:42
  • You have to divide the problem into smaller parts, then research all of them, and start working. Ideally you use the information your instructors gave you in your classes (I really doubt that you entered your first lesson and they told you "now leave and to this exercise"). Thing is: it is your assignment, so YOU are the one who has to start working on it. – GhostCat Oct 28 '20 at 11:46

1 Answers1

1

I thought about making a list of arrays of the coefficients and an array of the grades of the polynomials to store them.Then I made a function named "showRoots(grade,[]coeff) that checks which of the divisors of the term with grade 0(the free term) is a root by evaluating the polynomial in x=c0.If P(c0)==0, it means that this is a root and I stored them in an array named div.Then if showRoots for the next polynomial is also zero,it means that this is a common root.

  • Sorry, even if your question is intended to be self answered, to help others ... still many things to fix here. You would still have to reduce your question to a specific aspect, and give a good answer to that. You see, the whole point of "writing content for others": there must be a way for others to find your content. A broad question like yours ... wont attract viewers. It will rather be close voted, and then delete voted. I really appreciate your efforts, but I suggest you carefully study [help] to learn how this place works. – GhostCat Oct 28 '20 at 11:52