Fourth and fifth assignment from "Objects in Java"