My code is almost complete but I must figure out why my "reduceToLowestTerms() "doesn't get implemented through my code and make sure every time i enter a Fraction it does it.
My code is a little long so I will be posting the link! https://gist.github.com/anonymous/0421493909708268ea9e
private void reduceToLowestTerms()
{
this.switchSign();
int i1 = greatestCommonDivisor(this.numerator, this.denominator);
this.numerator = this.numerator / i1;
this.denominator = this.denominator / i1;
} // end reduceToLowestTerms
private int greatestCommonDivisor(int integerOne, int integerTwo)
{
int result;
if (integerOne % integerTwo == 0)
result = integerTwo;
else
result = greatestCommonDivisor(integerTwo, integerOne % integerTwo);
return result;
}
This is the code section that for some reason isnt being implemented throught the rest of my code How do i make sure all my fractions are in their lowest terms?