Method for multiplying two polynomials

Hello everyone,

i am having problems writing a method which can multiply 2 polynomials. Can u help me out???

this is what i have done:

public Poly mult(Poly p) {

int n = getDegree();

int m = p.getDegree();

Poly result = new Poly(m+n);

int i,j;

Poly a = p;

float sum=0;

float [] temp = new float[n+m+1];

for (i=0; i<=n+m; i++){

for(j=0;j<=m+n;j++){

sum = sum+ coefficients[i] * p.getCoefficient(j);

}

int x = i+j;

result.setCoefficient(x, sum);

}

return result;

}

in the main program, it will be run as q.mult(p);

hope to hear from u soon!!!!