Help me in solving JPRACREARR1 problem

My issue

Solution

Learning course: Practice Java
Problem Link: Rearrange Code Practice Problem in Java