Term(1) - return exponent; } public void setCoefficient(int...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
//** // a Term class representing the non-zero terms in polynomials //** public class Term { private int coefficient; private int exponent; Term() { coefficient = 0; exponent = 0; } Term (int i, int j) { setCoefficient (i); setExponent (j); } public int getCoefficient() { return coefficient; } public int getExponent() {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return exponent; } public void setCoefficient(int co) { coefficient = co; } public void setExponent(int ex) { exponent = ex; } public boolean equals(Term tm) { if (coefficient != tm.getCoefficient()) return false; if (exponent!= tm.getExponent()) return false; return true; } }...
View Full Document

Ask a homework question - tutors are online