Question: * Write a main function that prompts the user for a word and displays its * translation in Pig Latin, which has the following rules:

* Write a main function that prompts the user for a word and displays its * translation in Pig Latin, which has the following rules: * * * - If the word begins with a vowel, simply display the word appended by "YAY". If the word begins with a consonant, move ALL of the word's initial consonants to the end of the word and append it with "AY". * * * For this problem, Y is not considered a vowel. Assume all characters are uppercase alphabetic letters (i.e. A-Z). * * * Do not print one character at a time; instead, your program should create a * new character array with the translated word and print once (outside a loop) * at the end. * * [Sample Output) * [username@unixl - ]$ ./quiz3 * Enter Word: INTEGER * INTEGERYAY * * [username@unix1 - ]$ ./quiz3 * Enter Word: FLOAT * OATFLAY */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
