#include #include "myfrac.h" int main(){ cout << "Test 1:\n\n"; myFrac a(1, 2), b( 1, 3); myFrac c; c = a + b; // what happens here? who gets called and when? cout << "1/2 + 1/3 = " << c << endl; cout << "\nTest 2:\n\n"; myFrac d( a ); cout << d*d << endl; cout << "\nTest 3:\n\n"; myFrac x = myFrac( 2, 5 ); // who is called each time? // Careful! The syntax is confusing. myFrac y( 5 ); myFrac z = 3; cout << " x = " << x << endl; cout << " y = " << y << endl; cout << " z = " << z << endl; cout << "\nTest 4:\n\n"; cout << myFrac( 5, 12 ) + myFrac( 7, 12 ) << endl; cout << "\nTest 5:\n\n"; myFrac t = 1 + myFrac(1, 2); // what happens here? cout << t << endl; cout << "\nThat's All Folks! Time to destroy variables...\n"; return 0; }