Import java. util. Scanner;
public class PigLatin {
public static void main(String args[]) {<...
Computers and Technology, 12.11.2020 18:20 williamnason123
Import java. util. Scanner;
public class PigLatin {
public static void main(String args[]) {
Scanner console =new Scanner(System. in);
System. out. println("Please enter a word");
String phrase=console. nextLine();
System. out. println(eachWord(phrase));
}
public static String eachWord(String phrase) {
String help[]=phrase. split(" ");
for(int i=0; i
if (help[i].charAt(0) == 'a'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'e'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'i'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'o'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'u'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'A'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'E'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'I'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'O'){
return help[i] + "-ay";
}
if (help[i].charAt(0) == 'U'){
return help[i] + "-ay";
}
else {
return help[i].substring(1)+"-"+help[i].ch arAt(0)+"ay";
}
}
return "aoujbfgaiubsgasdfasd";
}
I need help with this Pig Latin Program. I want to split the string so each word can run through the method eachWord. I don't know how to revamp this!
Answers: 2
Computers and Technology, 22.06.2019 05:00
Which two editions of windows 7 support 64 bit cpus? choose two out of professional, business, starter, or home premium.
Answers: 1
Computers and Technology, 23.06.2019 11:00
In the context of the box model, what is the difference between a margin and a padding? a. a padding lies outside a box border, while a margin lies inside it. b. a padding lies inside a box border, while a margin lies outside it. c. a padding can be adjusted independently, while a margin depends on the size of its box. d. a padding depends on the size of its box, while a margin can be adjusted independently.
Answers: 3
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut off on an hev are both colored orange
Answers: 1
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
Chemistry, 11.11.2020 05:00
Biology, 11.11.2020 05:00
Mathematics, 11.11.2020 05:00
Health, 11.11.2020 05:00
Chemistry, 11.11.2020 05:00
Mathematics, 11.11.2020 05:00
Arts, 11.11.2020 05:00
English, 11.11.2020 05:00
Mathematics, 11.11.2020 05:00
History, 11.11.2020 05:00
Mathematics, 11.11.2020 05:00
English, 11.11.2020 05:00
History, 11.11.2020 05:00