problem 8 java
problem 9 java