Here you may find SamR's sample solutions for Exam 2.  Each problem
is in its own directory.  You can create the executables with 
"make".  You can clean out unneeded files with "make clean".

These examples are clearly not the only way to solve the problems.  They
are intended primarily to show one mechanism.
