CIS 114                                                     Summer 2005

                         Program 2 
        	         ---------
Credit: 75 Points.
Due Date:  Friday, June 17th, 6:00 PM.

15 points late penalty if it is late.

ZERO points if it is received after June 18th 6:00 PM.

1) Implement the array implementation of the stack as
shown in the tapes or in your text book.  Do NOT randomly
copy and paste some stack implementation from the Web.

It should be a Stack of INTEGERS.


2) Solve THE SAME PROBLEM like in Program 1 a), b), c),
but this time you may NOT use any array and you may NOT
use any linked list.  The only data structure you may use
is your STACK from part 1) above.  (And a small number of
simple variables.  You CANNOT have a variable for every number,
because potentially your file MAY contain 10000 numbers.)

Rather it has to work like this:

You read in numbers from the file and add them up as they come in.
You also put the numbers on the stack as they come in.

When you finished adding all numbers, you can compute the
mean value.

Now you compute the standard deviation.  For that you need 
the mean value and all the values you read in before.
Now you POP the numbers off the stack one by one to compute
the standard deviation.

You may NOT open the file again and read the numbers again.
You must use the STACK for solving the problem.

Your program should print trace messages every time you PUSH
something on the stack and every time you POP something from 
the stack.  Like this:

PUSHING NUMBER 4
PUSHING NUMBER....




General Comments:

1) Your program should be documented, as you learned in previous classes.
Internal documentation:  Brief explanations within the C++ code.
External documentation:  A brief write up (under a page length) explaining
what the program is doing, how to run it and where the files are.

The external documentation must be typed and spell-checked.  I WILL take 
points off for obvious errors, like sentences that end in the middle.

2) Your program should be reasonably indented.  I WILL take points
off for "random" or completely missing indentations.

3) Your submission should contain working code.  Don't bother submitting
if there are compiler error messages.  You will not get any points
for something that does not compile.  

If you get part of it working you get partial credit.  If you get
all of it "almost working" but it does not compile, you get no
credit at all.  So... try to advance from one working version to
the next, adding functionality slowly.

5) Your submission should also contain two screen dumps that show that 
the program is working.  

The burden of proof is up to you.  If you don't show it works, I will
assume it does not work.

6) I really prefer hardcopy submissions....  But, if you can't
(and most of you probably can't) send me ONE email with THREE attachments:

-- The C++ code
-- The screen dump (that shows that it works)
-- The external documentation.

Did I mention I prefer hardcopy submissions?

7) The subject line should say:
CS 114, Program 1