Modify the Fraction class so that fractions are reduced to their normal form; to reduce a fraction to its normal form divide denominator and numerator by their greatest common divisor; for example 1/2=2/4=4/8=...=n/2n=... with 1/2 being the normal form of n/2n.
Fraction class:
public class Fraction{
private int den;
private int num;
public Fraction(int numerator, int denumerator){
num=numerator;
den=denumerator;
}
public Fraction sum(Fraction f){
Fraction r=new Fraction(1,1);
r.num= ( f.den*num)+(den*f.num);
r.den=f.den*den;
return r;
}
}