 CSE 109 Programming Assignment #1   Due: 9 PM Sunday 15 February 2009
 [Late collections 9 PM  Monday 16 February, Tuesday 17 February 2009]

 This assignment is an exercise in creating a subclass.  I ask you to
 to create StCalc, a subclass of the class Calc that you developed for
 p0. The class StCalc should add to the calculator a pushdown stack
 that can hold a maximum of 20 doubles.

 I have stored a program for testing your class StCalc in the file
 /proj/csc109/p1/testP1.cc  Copy this file into your directory
 cse109.091/p1, renaming testP1.cc p1.cc.

 Create a Makefile for compiling p1.  DO NOT CHANGE THE CODE OF p1.cc AT
 ALL. I REPEAT, DO NOT CHANGE THE PROGRAM CODE IN ANY WAY OTHER THAN TO ADD
 DOCUMENTATION (name, assignment, program purpose, etc.,) ELSE LOSE AT LEAST
 20 PTS. I will test your subclass by using the command "make clean"
 to discard all .o files (where you should implement "clean" in your Makefile),
 by replacing your p1.cc with the the file /proj/csc109/p1/testP1.cc,
 by using your Makefile to compile p1.cc, and then by  running the resulting
 executable file p1. IT IS IMPORTANT THAT YOU COMPILE ALL YOUR .cc FILES
 WITH THE -Werror  -Wall OPTIONS (E.G., g++ -c -Werror -Wall p1.cc).
 NOTE THAT I MAY WELL USE OTHER PROGRAMS TO TEST YOUR CLASSES.

 When you are ready to submit your work, create the file "DONE" by executing
 the command "touch DONE".

 Notes: 1. All your files should have good documentation.  Each file should
         have identifying information at the top, e.g., your name, the course,
         the assignment number.  Your templated 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 member
         function should be explained (e.g., by stating pre- and
         post-conditions and by stating the overall algorithm).  Hard
         to understand sections of code should be explained.
        2. The class StCalc should be a sublcass of your class Calc from
         p0 and should implement the following methods, among others.
           push()  push the contents of the screen onto the stack, leaving
                   the screen unchanged
           pop()   pop the top of the stack to the screen
           add()   remove the top two entries on the stack, add them, and
                   put the result on the stack
           sub()   remove the top two entries on the stack, subtract the
                   first one removed from the second and put the result on
                   the stack
           mul()   pop the top two entries and push the product of the two
                   entries popped
           div()   pop the top two entires on the stack, divide the second
                   one removed by the first, and push the result on the stack
           <<      overload for instances of StCalc
        3. I have included sample output at the end of the file testP1.cc.
           Your results may vary slightly.
        4. Your class StCalc should be a subclass of class Calc, but what if
           your implementation of Calc is not functioning properly?  You can
           use my compiled version. I have stored my declaration of Calc in
           /proj/csc109/p1/calc.h and the object file in /proj/csc109/p1/calc.o.
           If you want to use these files IT IS VERY IMPORTANT YOU DO AS I
           DIRECT, otherwise you will cause me some aggravation, and it is
           unwise to aggravate me while I am grading your program.   First,
           wherever you need to include a copy of calc.h, use the statement
           #include "/proj/csc109/p1/calc.h"
           Second, all references to the file calc.o in your Makefile should
           be prefixed with /proj/csc109/p1
             For example, the p1: command might be
               p1: p1.o /proj/csc109/p1/calc.o stcalc.o
               <tab>  g++ -o p1 stcalc.o p1.o /proj/csc109/p1/calc.o

IN THE SYLLABUS READ THE STATEMENT ABOUT UNFAIR COLLABORATION AND AVOID
UNFAIR COLLABORATION
