Read the specification for PA2 then complete PA2 Readiness quiz in Canvas by Monday 9/22/17 11pm.  - Specificaiton for PA2

When you start testing PA2 the following may come in handy:

Screenshot from running values in PA2 Specificaiton.

PA2 Output Screenshot

  • You may want to run a Linux shell script to automate the testing of the .in files and the comparison with the .exp files.
  • Your shell script might do the following 
java Survey < test.in > test.out
diff test.out test.exp 
then repeat these commands for each test file and exp file pair.
Here's a simple shell script  testpa2.sh  to run all the tests from the zip file.  Make sure this script is in the same directory as your PA2 Survey.java file and that the test .in and .exp files are also uncompressed in that directory.
Then run it from the command line terminal via:
    . testpa2.sh
Your output should look like this if you are successful in running all the tests.
PA2 output

Back to Top