solutions to a few problems from the 1.3 section of Sedgewick's Intro to Programming in Java book