Solve problems 25,36 using Java.