completes assignment 2, chapter 6, java programming

Signed-off-by: Alexander Skjolden <alex@plastboks.net>