Solve problems 44-47 using Java.