3034ccom/lab01/frac.cpp
Fraction Fraction::add(const Fraction& F) const {

	Fraction localFrac;
	localFrac.setDenom(getDenom() * F.getDenom());
	localFrac.setNum( (getNum() * F.getDenom()) + (F.getNum() * getDenom()) );

	return localFrac.reduce();

}
// Function add
//	Without modifying the calling Fraction object, 
//	adds two Fractions and returns the resulting
// 	Fraction object.
Function add
Without modifying the calling Fraction object,
adds two Fractions and returns the resulting
Fraction object.
Function add Without modifying the calling Fraction object adds two Fractions and returns the resulting Fraction object .
Fraction Fraction::add(const Fraction& F) const {
	Fraction localFrac;
	localFrac.setDenom(getDenom() * F.getDenom());
	localFrac.setNum( (getNum() * F.getDenom()) + (F.getNum() * getDenom()) );
	return localFrac.reduce();
}
Fraction Fraction :: add ( const Fraction & F ) const { Fraction localFrac ; localFrac . setDenom ( getDenom ( ) * F . getDenom ( ) ) ; localFrac . setNum ( ( getNum ( ) * F . getDenom ( ) ) + ( F . getNum ( ) * getDenom ( ) ) ) ; return localFrac . reduce ( ) ; }
Function add
Without modifying the calling Fraction object,
adds two Fractions and returns the resulting
Fraction object.
Function add Without modifying the calling Fraction object adds two Fractions and returns the resulting Fraction object .