so for my 102 class i was told to make a fraction class and i was given a test driver to make sure i did everything right. however, it seems that all my add, subtract, multiply, and divide fractions have some type of error in them or else i'm messing up when i try to simplify the fraction. here's the code for my Fraction class, if you want to see the test driver, i have that available as well. thanks

Code:/** * This class will store a fraction in reduced form and * allow for the user to add, subtract, multiply, or divide * the fraction. * * @author Bryan Chan * @version Program 1 * @version CPE102-9 * @version Winter 2009 */ public class Fraction { private int num, denom; private double numValue; //constructors public Fraction() { num = 0; denom = 1; } public Fraction( int numerator ) { num = numerator; denom = 1; } public Fraction( int numerator, int denominator ) { num = numerator / gcd( numerator, denominator ); denom = denominator / gcd( numerator, denominator ); if( num == 0 ) { denom = 1; } if( num == denom ) { num = 1; denom = 1; } if( denom <= 0 ) { throw new IllegalArgumentException(); } } //methods public Fraction add( Fraction other ) { if( denom == other.getDenominator() ) { num += other.getNumerator(); } else { num = ( num * other.getNumerator() ) + ( other.getNumerator() * denom ); denom *= other.getDenominator(); } System.out.print( num + "/" + denom + "\n" ); return new Fraction( num, denom ); } public Fraction div( Fraction other ) { num = num * other.getDenominator(); denom = denom * other.getNumerator(); return new Fraction( num, denom ); } public boolean equals( Fraction other ) { if( ( num / denom ) == ( other.getNumerator() / other.getDenominator() ) ) { return true; } else { return false; } } public int getDenominator() { return denom; } public int getNumerator() { return num; } public Fraction mul( Fraction other ) { num = num * other.getNumerator(); denom = denom * other.getDenominator(); System.out.print( num + "/" + denom + "\n" ); return new Fraction( num, denom ); } public Fraction sub( Fraction other ) { if( denom == other.getDenominator() ) { num -= other.getNumerator(); } else { num = ( num * other.getNumerator() ) + ( other.getNumerator() * denom ); denom *= other.getDenominator(); } return new Fraction( num, denom ); } private int gcd( int a, int b ) { if( b == 0 ) { return a; } else { return gcd( b, a % b ); } } public String toString() { if( denom == 1 ) { return "" + num; } else { return num + "/" + denom; } } public double value() { return (double)num / denom; } }