Question: RAO Chapter 9 CT Exercise Prompt the user to enter a sentence to be converted. For each word in the sentence, convert it to the

RAO Chapter 9 CT Exercise Prompt the user to enter a sentence to be converted.
For each word in the sentence, convert it to the corresponding pig Latin version.
create a value-returning function called convert_to_pig(word) that takes the English
word as a parameter, and returns the pig Latin version.
Until we learn about lists, you'll need to do this the hard way. TIPS:
You'll need to pass a sub-string of the sentence to the function using the slice
operator [:]
In order to pass the correct sub-string, you'll need to iterate through the string using
an index and check to see if the character at the current index is a space or the end
punctuation
You'll need to keep track of where the start of your sub-string is and the end will be
what your current index is if the character is a space or the end punctuation.
This flow chart may help you (it does not contain all the required steps):
To keep things simple, assume the sentence the user enters contains an ending
punctuation and no other symbols (commas, semi-colons, etc.)
Do not use lists for this assignment. If you use a list, you'll automatically lose 50% credit.
Output the full sentence to the user with correct capitalization and use the same punctuation.
Output Example:Your sentence in Pig Latin is:
In this assignment you are going to create a simplified pig Latin generator. It will follow the
following rules:
The first letter will be placed at the end of the word and add 'ay'
ex: 'that' -> 'hattay'
If the work starts with a vowel just add 'ay' to the end
ex. 'owl' -> 'owlay'
You'll need to use functions, selection statements, iteration, and the accumulator pattern to
accomplish this task correctly.
Setup:
In your week7 folder (created during the previous assignment), create a Python file called
ch9_ct_
 RAO Chapter 9 CT Exercise Prompt the user to enter a

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!