Exercise on Java Control Structures