'Java - How to return term as a polynomial
I have an array storing the coefficient and exponent of each term of a polynomial, type Term(coefficient, exponent). I need to return the polynomial as a string for display with each term in the form "coefficient*x^exponent".
Here's what I have so far.
public Polynomial solveSequence()
{
int exponent;
int i = 0;
Term[] poly = new Term[i];
while (exponent > 0)
{
poly[i] = nextTerm();
updateSequence(nextTerm());
getSequence();
i++;
}
return null;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
