Question: 2.7.4. Programming Challenge : Pig Latin Can you speak Pig Latin? In Pig Latin, you take the first letter and put it at the end

 2.7.4. Programming Challenge : Pig Latin Can you speak Pig Latin?In Pig Latin, you take the first letter and put it at

2.7.4. Programming Challenge : Pig Latin Can you speak Pig Latin? In Pig Latin, you take the first letter and put it at the end of the word and add the letters "ay" to the end. For example, "pig" becomes "igpay". Create a program that takes a word and transforms it to Pig Latin using String methods. You may need the word's length, a substring that does not include the first letter, and a substring that is just the first letter (you can get the ith letter of a string using substring(1,1+1) so for example the letter at index 3 would be substring(3,4)). Your teacher may ask you to create this program in a Java IDE like repl.it so that you can use input to read in the word (see input examples using the Scanner class). Use the substring method to transform a word into Pig Ltin where the first letter is put at the end and "ay" is added. The word pig is igpay in Pig Latin. 1 public class PigLatin 2 { 3 public static void main(String[] args) { 4 5 6 String word = 7 8 // Use word.substring to construct word in pig latin String pigLatin 9 10 11 System.out.println(word + in Pig Latin is" + pigLatin); 12 13 }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!