/** program to convert one word into pig latin: simple form: take first letter, move to end, add "ay" suffix better form: if consonant, do above if vowel, don't move letter, just add "hay" suffix */ import java.util.Scanner; public class pigLatin { public static void main(String[] args) { Scanner keys = new Scanner(System.in); String word, piggy; char first; System.out.print("enter a word: "); word = keys.next(); first = word.charAt(0); first = Character.toLowerCase(first); // if (first != 'a' && first != 'e' && first != 'i' && first != 'o' && first != 'u') // consonant if ( ! (first == 'a' || first == 'e' || first == 'i' || first == 'o' || first == 'u')) // consonant piggy = word.substring(1) + first + "ay"; else { piggy = word + "hay"; } System.out.println("pig latin version: " + piggy); } }