Question: Need help with the C++ program. Part III: Separate compilation Split your program into 2 files: Ratio h and client.cpp. .Ratio.h contains the class declaration
Part III: Separate compilation Split your program into 2 files: Ratio h and client.cpp. .Ratio.h contains the class declaration and definitions of Ratio member functions. client.cpp contains the main program. Bonus: Overload the+,/operators to perform arithmetic operations on your new Ratio data type. Then the following main function should be valicd. int main0 Ratio fraci (3, 10): Ratio frac2 (3, 10) Ratio sum frac1 + frac2i I/stores 41/70 Ratio div fraci frac2; //stores -1/70 Ratio product fraci frac2: //stores 3/35 (which is the reduced form of 6/70) printRatio (product) //prints 3/35 Ratio quotient fraci / frac2: //stores 20/21 that we can improve your experience
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
