Programming in Java Coursework 2