Pig Latin Assignment
Complete the function TranslateToPigLatin. It should encode English language phrases into pig Latin. Pig Latin is a form of coded language often used for amusement. Many variations exist in the methods used to form pig Latin phrases. For consistency, use the following algorithm:
For words that begin with a single consonant take the consonant off the front of the word and add it to the end of the word. Then add ay after the consonant. Here are some examples:
cat = atcay dog = ogday simply = implysay noise = oisenay
For words that began with double or multiple consonants take the group of consonants off the front of the word and add them to the end, adding ay at the very end of the word. Here are some examples:
scratch = atchscray thick = ickthay flight = ightflay grime = imegray
For words that begin with a vowel, just add yay at the end. For
is = isyay apple =appleyay under = underyay octopus = octopusyay
For simplicity sake we will consider y a consonant.
Please enter a phrase to be translated to Pig Latin:
this is a test
isthay isyay ayay esttay
I will use the following main function to test your function. Add additional functions where appropriate.