COP2002 Project 10-1: Pig Latin Translator solution

$24.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (4 votes)

Create a program that translates English to Pig Latin.
Console
Pig Latin Translator
Enter text: Tis but a scratch.
English: tis but a scratch
Pig Latin: istay utbay away atchscray
Continue? (y/n): y
Enter text: We are the knights who say nee!
English: we are the knights who say nee
Pig Latin: eway areway ethay ightsknay owhay aysay eenay
Continue? (y/n): n
Specifications
 Convert the English to lowercase before translating.
 Remove any punctuation characters before translating.
 Assume that words are separated from each other by a single space.
 If the word starts with a vowel, just add way to the end of the word.
 If the word starts with a consonant, move all of the consonants that appear before the first vowel to
the end of the word, then add ay to the end of the word.
 If a word starts with the letter y, the y should be treated as a consonant. If the y appears anywhere else
in the word, it should be treated as a vowel.
 Save the file with the filename pig_latin_XXX.py where XXX is either your initials or your last
name.
Note:
 There are no official rules for Pig Latin. Most people agree on how words that begin with consonants
are translated, but there are many different ways to handle words that begin with vowels.