Question: Write a program that encodes English-language phrases into pig Latin. To translate an English word into a pig Latin word, place the first letter of

Write a program that encodes English-language phrases into pig Latin. To translate an English word into a pig Latin word, place the first letter of the English word at the end of word and add "ay". For example, "dog" would become "ogday" and cat would become "atcay".

Your program should prompt the user to enter an English sentence and then print the sentence with every word changed to pig latin. (One way to do tis would be to split the sentence into words with the split() method.) For simplicity, there will be no punctuation in the sentences.

Run like:

Enter a string to be translated: the fox jumps over the lazy dog

hetax oxfay umpsjay veroay hetay azylay ogday

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!