completes assignment 5b, chapter 5, java programming

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