CS 1321 (Principles of Algorithm Design II):
Homework #7 Sample Solution

Sample solution code

Not available.

Testing

Testing the stack class

We tested the stack class with two test programs, one testing a stack of ints and one testing a stack of chars. Here is the code for the test programs:

Each test program requires input from standard input. We ran each program with several different input files:

Here is the expected output:

Testing the tautology checker program

We tested the completed tautology-checker program with the following self-contained script file:

Here is its expected output: