I have been trying to get my piglatin translator to translate more than one word but dont know how to. Please help, this following code is what I have and it works for one word only at a time.
import java.util.Scanner;
/**
* Write a description of class pigLatin here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class pigLatin
{
public static void main(String[] args)
{
Scanner myScan = new Scanner(System.in);
String word= "";
String vowelA="a";
String vowelE="e";
String vowelI="i";
String vowelO="o";
String vowelU="u";
System.out.println("Enter a word to be converted to pig latin");
word = myScan.nextLine();
if (word.startsWith(vowelA) || word.startsWith (vowelE)|| word.startsWith (vowelI)|| word.startsWith (vowelO) || word.startsWith (vowelU))
{
System.out.println(word+ "way");
}
else
{
System.out.println (word.substring(1) + word.charAt(0)+("ay"));
}
}
}