Homework for Java programming.