problem 5 java