// signatures and example method for the HugeInteger class public class HugeInteger { int digits[]; // you can name them whatever you want int sign; public HugeInteger() public HugeInteger (int val) public HugeInteger (HugeInteger x) public HugeInteger AddHugeIntegers(HugeInteger a) public HugeInteger SubtractHugeIntegers(HugeInteger a) public void inputHugeInteger(BufferedReader d) public void printHugeInteger() public HugeInteger ChangeSign() // perhaps useful, but not required public boolean lessThan(HugeInteger a) // an example method { // return true if and only if this < a // e.g. if h1=HugeInteger(2) and h2=HugeInteger(4), then // h1.lessThan(h2) returns true if (this.sign < 0) { if (a.sign < 0) { // both are negative, so return -a < -this return ( a.ChangeSign().lessThan(this.ChangeSign()) ); } else { // this is negative but a is not return true; } } else { // this is non-negative if (a.sign < 0) { return false; } } // now we can assume that this and a are both non-negative // either or both may be zero, though int j; for (j = 40; j > 0; j--) { if (this.digits[j-1] != a.digits[j-1]) { return (this.digits[j-1] < a.digits[j-1]); } } // if we get to here, it means the comparands are equal, so return false; } public int numPlaces() // perhaps useful, but not required public String toString() // perhaps useful, but not required