// Don't forget documentation comments public class Rational implements ExtendedNumber, Comparable { // Some fields and an enum must be declared here // implement setNums method // implement simplify method private static int gcd(final int a, final int b) { int x = a, y = b; if (x < y) x = -x; if (y > 0) y = -y; if (y == 0) return x; return gcd(y, x%y); } // implement the three constructors // default constructor // copy constructor // constructor which takes two int arguments // implement getNumerator // implement getDenominator // implement setDisplayStyle public Rational add(Rational r) { // you still need to code this } public Rational subtract(Rational r) { // you still need to code this } public Rational multiply(Rational r) { // you still need to code this } public Rational divide(Rational r) { // you still need to code this } public Rational increment() { // you still need to code this } public Rational decrement() { // you still need to code this } public int compareTo(Rational r) { // you still need to code this } @Override public boolean equals(final Object obj) { boolean result = false; if (obj instanceof Rational) { Rational r = (Rational) obj; result = (this.num == r.num && this.den == r.den); } return result; } @Override public int hashCode() { return (41 * (41 + num) + den); } @Override public String toString() { // you still need to code this } }