Third assignment from "Objects in Java"