CSE 109   Program #0   Due 9:00 PM Sunday 8 February 2009
   (Late collections: 9:00 PM  9, 10 February 2009)

In this assignment I ask you to develop a class whose objects are meant
to implement the Abstract Data Type (ADT) for a Calculator.  For our
purposes, a Calculator has a screen, 10 memory locations for saving (partial)
calculations, and can perform addition, subtraction, multiplication, and
division.

In /proj/csc109/p0 I have stored the file p0.cc, which is a driver for
testing the class Calc, which implements the ADT for a Calculator.  The file
p0.cc has, at the bottom, the output that was produced when it was run using
my implementation of Calc.  Further, I have stored the file 'Makefile' in
/proj/csc109/p0. You should copy the files  /proj/csc109/p0/p0.cc and
/proj/csc109/p0/Makefile into your directory cse109.091/p0 (a directory
you should create).  You should do all your work in the directory
cse109.091/p0.  I will collect your work from there.

You should add to p0.cc your declaration of class Calc (before main()),
as well as the definitions (code) (after main()), BUT DO NOT CHANGE THE
*CODE* THAT I WROTE IN p0.cc AT ALL (BUT IT IS VERY IMPORTANT THAT YOU DO ADD
DOCUMENTATION). DO NOT CHANGE THE CODE THAT I WROTE IN ANY WAY, but ADD
DOCUMENTATION (name, assignment, program purpose, etc.,) AND YOUR OWN CODE
FOR THE CLASS Calc. OTHERWISE YOU WILL LOSE AT LEAST 20 PTS. I will test
your class Calc by compiling and running your p0.cc. (The command 'make'
will use the Makefile to do the compilation)

When you are ready to submit your work, create the file "DONE" by executing
the command "touch DONE".

Notes: 1. Both your file p0.cc and your makefile, should have good
         documentation.  Each file should have identifying information at the
         top, e.g., your name, the course, the assignment number.
         Your class should be documented with comments at the top which
         explain the class and its purpose.  The role of each data member
         should be explained.  Each function and operator should be explained
         (e.g., by stating pre- and post-conditions and by stating the overall
         algorithm).  Hard to to understand sections of the code (definitions)
         should be explained.
       2. For neatly displaying doubles, see p528 of the text (Savitch).
       3. The overloaded arithmetic operators perform the indicated operation
          by taking the right handside, applying it to the screen, and then
          return the instance of Calc.  For example, if I have an instance of
          Calc, called aC, then the operation aC+6 adds 6 to the screen and
          returns aC.
       4. The operation memAdd() adds the contents of the screen to the given
          memory location; the operation memClear() sets the given memory
          location to 0; and the operation memRem() stores the contents of
          the given memory location on the screen.
       5. Instances of Calc operate on doubles.
       6. The operator >> reads from the console and stores the value read
          on the screen.
       7. The method opM(), uses the given memory location to perform an
          arithemetic operation with the screen. For example,
          opM(Calc::ADD, 3) increments the screen by the contents of memory
          3.

IN THE SYLLABUS READ THE STATEMENT ABOUT UNFAIR COLLABORATION AND AVOID
UNFAIR COLLABORATION

