Skill Building Exercises

 < Day Day Up > 



  1. Expand Person Class: Expand the capabilities of the Person class's overloaded assignment operator to include copying sex and age data.

  2. Foo Class: Create your own Foo class. Give it a few private data attributes. I will leave their types to your discretion. Overload the stream insertion and extraction operators to write the private members to a file, extract them from a file, and print them to the console. Use the overloaded insertion and extraction operators found in the Person class as a guide. Write a main() function to test the operators.

  3. Expand Foo Class: Expand the capabilities of the Foo class you created above to include the following overloaded arithmetic operators: *, /, %. Write a main() function to test the operators.

  4. Expand Foo Class: Expand the capabilities of the Foo class to include the following overloaded compound operators: -=, *=, /=, %=. Write a main() function to test the operators.

  5. Expand Foo Class: Continue to expand the capabilities of the Foo class. Overload the following relational operators: >, <=, >=. Write a main() function to test these operators.



 < Day Day Up > 



C++ for Artists. The Art, Philosophy, and Science of Object-Oriented Programming
C++ For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504028
EAN: 2147483647
Year: 2003
Pages: 340
Authors: Rick Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net