|
Add the following member function to CAddress class in program caddress04.cpp:
For the function, include detailed documentation and properly indented source code. Submit the following: § Printed source code of the working program (to get any credit the function has to work) § Printed output § Self-evaluation table
The test driver function should be as follows: void testCAddressSwap(void) { cout << "testCAddressSwap\n"; cout << "================\n"; for (int i=1; i<=TEST_COUNT; i++) { CAddress a1('r'), a2('r'); cout << "a1=\n"; cout << a1 << endl; cout << "a2=\n"; cout << a2 << endl; a1.swap(a2); cout << "After CAddress a1.swap(a2);\n"; cout << "a1=\n"; cout << a1 << endl; cout << "a2=\n"; cout << a2 << endl; cout << "-------------------------\n"; } }
The output from the program should be similar to the following: testCAddressSwap ================ a1= First Name: Ann Last Name: Rather Street: 34 Rouse Dr City: Joplin State: AR Zip: 44234 Age: 56
a2= First Name: Bob Last Name: Howard Street: 12 Joplin St City: Miami State: KS Zip: 62123 Age: 20
After CAddress a1.swap(a2); a1= First Name: Bob Last Name: Howard Street: 12 Joplin St City: Miami State: KS Zip: 62123 Age: 20
a2= First Name: Ann Last Name: Rather Street: 34 Rouse Dr City: Joplin State: AR Zip: 44234 Age: 56
------------------------- |