Lab 5 Fraction addition (with overloaded operators)


Re-write the add method for your Fraction class (from lab3) as an overloaded addition (+) operator. Your main program should perform the same as in lab3. If time permits (but not required), implement additional mathematical operations by overloading other operators in your Fraction class. As in lab4, implement your Fraction class in separate source and header files.


Compile your program using the GNU C++ compiler, g++, as follows:


jdoe@shaula % g++ -c Fraction.C

jdoe@shaula % g++ -c lab5.C

jdoe@shaula % g++ -o lab5 lab5.o Fraction.o

(lab5 is the resultant program executable name)



To execute your program:


jdoe@shaula % lab5