Project no. 24 in Java