1. 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.
    1. Correctness (35 points)
      1. arithmetic operations correctly performed (12 points)
      2. d operator duplicates the top value on the stack (4 points)
      3. p operation prints the top value on the stack and leaves the top value unchanged (4 points)
      4. f prints all the values on the stack and leaves the stack unchanged (10 points)
      5. c clears the stack by popping off all values (4 points)
      6. q quits the program (1 point)
    2. Program Design (18 points)
      1. Stack printing (the f operation) is implemented by popping elements off the operand stack and pushing them onto a temporary printing stack (9 points)
      2. 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)
    3. Error detection (12 points)
      1. an error message is printed if the user attempts an arithmetic operation when there are fewer than two operands on the stack
      2. an error message is printed if the user attempts to duplicate the top value on the stack when the stack is empty
      3. an error message is printed if the user tries to print the top value of the stack and the stack is empty
      4. an error message is printed if the user attempts to pop a value off the stack but the stack is empty
      5. 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
      6. an error message is printed if the user attempts an unsupported operation

  2. Design Document (15%): Are the program traces performed correctly?

  3. Commenting (10%): See the commenting information on the course's web page for advice on how to comment your programs,

  4. Program Style (10%): Are the programs well-organized and do they solve the problem in the most straightforward, efficient