Ninth assignment from "Introducing Java"