Computer Science, asked by jedi1, 1 year ago

write program in java to accept a word and display the same in pig latin

Answers

Answered by Akhilrajp
1
rggdgdhhhfjjoeiiwhwgagddhgh
Answered by sou7474
3

class propereasypiglatin

{

   static void accept(String S)

   {

       String S1=S.trim();

       String s=S1.toUpperCase();

       char t=s.charAt(0);

       if(t=='A'||t=='E'||t=='I'||t=='O'||t=='U')

       {

        String s1=s.substring(1);

        String s2=s.substring(0,1);

        String s3="WAY";

        String f1=s1+s2+s3;

        System.out.println(f1);

       }

       else

       {

        String s4=s.substring(1);

        String s5=s.substring(0,1);

        String s6="AY";

        String f2=s4+s5+s6;

        System.out.println(f2);

       }

   }

}

Similar questions