Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLE HELP ME BY PYTHON PLE HELP ME BY PYTHON Pig Latin Write a program that accepts a sentence as input and converts each word

PLE HELP ME BY PYTHON

image text in transcribed

PLE HELP ME BY PYTHON

Pig Latin Write a program that accepts a sentence as input and converts each word to "Pig Latin" To convert a word to Pig Latin: If the word begins with a vowel, add "way" at the end of the word. Otherwise, move all the consonants from the beginning of the word to the end, and append "ay" to the string. For the purposes of this program, a, e, i, o, u, and y are all considered as vowels. You may convert the output to all lower case and ignore all punctuation (other than spaces). Here are some examples of input and output: Python is a programming language ythonpay isway away ogrammingpray anguagelay Your strong ox plows the field yourway ongstray oxway owsplay ethayieldfay Your program will repeatedly request user input and convert it to Pig Latin until the user just presses ENTER (with no text) to quit. Extra credit 1: if a word begins with a capital letter, make sure the translated word also begins with a capital. Example: Grover Cleveland was a President - Overgray Evelandclay asway away Esidentpray Extra credit 2: Handle the letter y better. If y is the first letter of the word, as in yes or yacht, treat it as a consonant. Otherwise, treat it as a vowel, as in style or mystery. (This rule will fail on words of foreign origin such as yttrium and Yggdrasil.) Extra credit 3: Handle words beginning with qu correctly. As stated in the original rules, the algorithm would improperly change quest to uestgay instead of the correct estquay. When you finish, name your program in the form Lastname_firstname_pig_latin.py and upload it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

a. Describe the encounter. What made it intercultural?

Answered: 1 week ago