CS260

MP9


Please see program documentation requirement.


Problem 1*

In the file mp9a, a class called MoneyType is defined as well as a small test driver to exercise the class. For this MP you will add the following functionality to the class MoneyType:

  1. Add a function Sub that will subtract money values (much like add).
  2. Add a function Mult that will multiply a money value by a multiplier (like 0.5).
  3. Add a function DollarsAndCentsAre which will print out (using cout) the complete value of a money value.

Be sure and add test cases to the main function to test these new functions.

Save your modifed program as mp09a.cpp.


Problem 2*

In the file mp9b.cpp, an outline of a class call FracType is given. Complete the implementation of FracType and write a test driver to test all functions.

Save your program as mp09b.cpp.


What You'll Turn In:

A diskette labeled with your name, course # and containing the files mp09a.cpp and mp09b.cpp.


* problem from Dale, N., A Laboratory Course in C++, Jones and Bartlett,1997.