package rational; public class RationalNumberTester { public static void main(String[] args) { System.out.println("RationalNumberTester written by S. Robbins"); RationalNumber r1 = new RationalNumber(3, 4); System.out.println("r1 = " + r1); RationalNumber r2 = new RationalNumber(2, 3); System.out.println("r2 = " + r2); RationalNumber r3 = r1.add(r2); System.out.println("The sum r3 is " + r3); RationalNumber r4 = new RationalNumber(6, 12); System.out.println("r4 is " + r4); RationalNumber r5 = r1.multiply(r2); System.out.println("r5 = " + r5); System.out.println("r4 equals r5 is " + r4.equals(r5)); System.out.println("r5 equals r4 is " + r5.equals(r4)); System.out.println("The reciprocal of r1 is " + r1.reciprocal()); System.out.println("r1/r2 is " + r1.divide(r2)); System.out.println("r1.compareTo(r2) is "+r1.compareTo(r2)); System.out.println("r2.compareTo(r1) is "+r2.compareTo(r1)); System.out.println("r4.compareTo(r5) is "+r4.compareTo(r5)); System.out.println("decimal value of r4 is "+r4.getDecimalEquivalent()); } }