PA07

A Pig Latin Translater

Objective: Get more practice with strings, looping, and writing functions

 


Code due by Wednesday, April 7th, at 11:59pm


An introduction

You are contacted by Mr. I. Hoggs, president of the IPLS (International Pig Latin Society).  He admits that despite being president of the society, he has always had some difficulty converting from English to Pig Latin.  He asks if you could help him by writing a program to convert words/sentences from English to traditional "Pig Latin." 

Pig Latin?

Some of you may have played with Pig Latin as a kid.  There are many slightly different rule sets for Pig Latin.   The version we will use is:

The Final Project

I want your code to take in a single sentence (with no punctuation except the ending period) and translate that sentence into pig latin.

Let's think about this problem from the top down.  Our full blown project should:

  1. Read a single "sentence" from the user.
  2. Break the sentence into individual words
  3. For each word, convert it into PigLatin...
  4. by finding the first vowel (if it exists)
  5. And finally, print out these converted words in normal sentence format

As we look at this project, we want to do this in several manageable steps (incremental development).


Part A - Finding the first vowel

Begin by writing  a function (in a file called pa07.py) called findFirstVowel().  This function should

For example,


Part B - Translating one word

Now, write another function called translateWord() that:

For example,


Part C - Starting to translate one sentence

This turns out to have several pieces to it, so let's break it down into sub steps

Now add a function to your code called pigLatinTranslator().  This function should:

You should put these translated words back together into a single sentence string. Once you have done that, your function should:

For example,


Final Submission

Please submit your pa07.py file to the autolab Program Submission System. It will be grading your code by running each function individually. This means you will get some points for getting the first function to work, some points for getting the second function to work, and some more points for getting the last function to work. However, please don't just submit things to the grading system before testing them on your end. It would be a good idea for you to write a testing suite like we used in lab 8 to test your own function to make sure they work.

Don't forget to fill in your function comments!