3034ccom/lab01/frac.cpp
Fraction Fraction::reduce() {

	Fraction localFrac;

	localFrac.setNum(getNum());
	localFrac.setDenom(getDenom());


	for (int denomC = localFrac.getDenom(); denomC > 1; --denomC) {
		if (localFrac.getNum() % denomC == 0 && localFrac.getDenom() % denomC == 0) {
			localFrac.setNum(localFrac.getNum() / denomC);
			localFrac.setDenom(localFrac.getDenom() / denomC);
		}
	}

	return localFrac;

}
//	Function reduce
//	Reduces the calling Fraction object to its lowest
//	possible form. This is done by checking if the denominator
// 	is a common divisor of both the current denominator
//	and the numerator. If not, we subtract 1 from the denominator
//	and check again, until the denominator is 2. 
Function reduce
Reduces the calling Fraction object to its lowest
possible form. This is done by checking if the denominator
is a common divisor of both the current denominator
and the numerator. If not, we subtract 1 from the denominator
and check again, until the denominator is 2.
Function reduce Reduces the calling Fraction object to its lowest possible form . This is done by checking if the denominator is a common divisor of both the current denominator and the numerator . If not we subtract 1 from the denominator and check again until the denominator is 2 .
Fraction Fraction::reduce() {
	Fraction localFrac;
	localFrac.setNum(getNum());
	localFrac.setDenom(getDenom());
	for (int denomC = localFrac.getDenom(); denomC > 1; --denomC) {
		if (localFrac.getNum() % denomC == 0 && localFrac.getDenom() % denomC == 0) {
			localFrac.setNum(localFrac.getNum() / denomC);
			localFrac.setDenom(localFrac.getDenom() / denomC);
		}
	}
	return localFrac;
}
Fraction Fraction :: reduce ( ) { Fraction localFrac ; localFrac . setNum ( getNum ( ) ) ; localFrac . setDenom ( getDenom ( ) ) ; for ( int denomC = localFrac . getDenom ( ) ; denomC > 1 ; -- denomC ) { if ( localFrac . getNum ( ) % denomC == 0 && localFrac . getDenom ( ) % denomC == 0 ) { localFrac . setNum ( localFrac . getNum ( ) / denomC ) ; localFrac . setDenom ( localFrac . getDenom ( ) / denomC ) ; } } return localFrac ; }
Function reduce
Reduces the calling Fraction object to its lowest
possible form.
Function reduce Reduces the calling Fraction object to its lowest possible form .