(java) Solved problem 11, 12, 13 and 14