Attempt at exercises from *Java, A Beginner's Guide* 5th ed.