Solved Please Write A Java Code For The Attached Question

Solved Please Write A Java Code For The Attached Question