Code Below:


import java.util.*;
class piglatin
{
    public static void main()
    {
        Scanner s=new Scanner(System.in);
        int l,i;
        System.out.println("Enter a word");
        String st=s.next();
        st=st.toUpperCase();
        l=st.length();
        for (i=0;i< l;i++)
        {
            if (st.charAt(i)=='A' || st.charAt(i)=='E' || st.charAt(i)=='I' || st.charAt(i)=='O' || st.charAt(i)=='U')
            {
                System.out.print(st.substring(i)+st.substring(0,i)+"AY");       //revise LIMITS of SUBSTRING function
                break;
            }
        }
    }
}