Java代写- Java exercise

Java代写:这是一个简单的java练习题目

Write your code in the file PigLatin.java. Your code should go into a method with the following signature. You may write your own main method to test your code. Auto lab will ignore your main method:

public static String translate ( String original ){}

"Pig Latin" is a fake language used as a children’s game. A word in English is"translated" into Pig Latin using the following rules:

If the English word begins with a consonant, move the consonant to the end of the word
and add "ai". The letter Y should be considered a consonant.
If the English word begins with a vowel (A, E, I, O, or U), simply add "vai" to the end of the
word.

(This is a simplified dialect of Pig Latin, of course.)

Write your method so that it returns the pig latin translated original string. You mayassume that the input does not contain digits, punctuation, or spaces. The inputmay be in any combination of uppercase or lowercase. The case of your output doesnot matter.

发表评论

电子邮件地址不会被公开。 必填项已用*标注