completed assignment 4, chapter 5, Java programming

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