Use the Canvas link to submit your work.
Educational goals of this lab - verify that every student can
INSTRUCTIONS:
(90 points) Problem : Pig Latin Translator
Enter a sentence: A sentence to be translated by a knight Away entencesay otay ebay ranslatedtay ybay away nightkay
input sentence split sentence into list of words initialize new sentence make a string of all the vowels loop each word of the words in sentence if word[0] in vowels add to new sentence with suffix else add to new sentence with suffix print new sentence
Enter a sentence: The magic word is XYZZY strength eThay agicmay ordway isway XYZZYay engthstray
Put at bottom of file as usual.
Description | Input (Parameter) | Expected Output (return) |
---|---|---|
vowel in first position | angle | returns 0 |
vowel in second position | castle | returns ____A.___ |
vowel in third position | train | returns ___B.___ |
no vowel at all | hymn | returns _____C._____ |
Description | Input | Expected Output |
---|---|---|
one-word sentence | Victory | ____D.____ |
two-word sentence | get out | ____E.____ |
sentence with lots of whitespace | the cat in the hat | ____F.____ |
empty string | "" | ____G.____ |
word with no vowels | xyzzy | ____H.____ |
word with vowel in position 0 | apple | ____I.____ |
word with vowel in position 4 | syllable | ____J.____ |