- Program Correctness (65%): mydc does everything that the
lab requires. If you have a question about how mydc handles
a certain input, check the executables that have been provided.
- Correctness (35 points)
- arithmetic operations correctly performed (12 points)
- d operator duplicates the top value on the stack (4 points)
- p operation prints the top value on the stack and leaves
the top value unchanged (4 points)
- f prints all the values on the stack and leaves the stack
unchanged (10 points)
- c clears the stack by popping off all values (4 points)
- q quits the program (1 point)
- Program Design (18 points)
- Stack printing (the f operation)
is implemented by popping elements off the
operand stack and pushing them onto a temporary printing stack
(9 points)
- Integers are pushed onto the operand stack by casting them to
a void * and they are retrieved from the stack by casting the
void * return values to ints.
(9 points)
- Error detection (12 points)
- an error message is printed if the user attempts an arithmetic
operation when there are fewer than two operands on the stack
- an error message is printed if the user attempts to duplicate
the top value on the stack when the stack is empty
- an error message is printed if the user tries to print the
top value of the stack and the stack is empty
- an error message is printed if the user attempts to pop a
value off the stack but the stack is empty
- an error message is printed if the user attempts to swap the
top two values on the stack but the stack has fewer than two
elements
- an error message is printed if the user attempts an unsupported
operation
- Design Document (15%): Are the program traces performed correctly?
- Commenting (10%): See the commenting
information
on the course's web page for advice on how to comment your programs,
- Program Style (10%): Are the programs well-organized and do they
solve the problem in the most straightforward, efficient