Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Pig Latin Filename: PIGLATN Pig latin is a simple code. To convert a word to pig latin, break it at the first vowel, put the

Pig Latin

Filename: PIGLATN

Pig latin is a simple code. To convert a word to pig latin, break it at the first vowel, put the leading consonants at the end, followed by 'ay.' If the first letter is a vowel, just put 'hay' at the end. For example, 'cat' becomes 'atcay', 'frog' becomes 'ogfray' and 'ant' becomes 'anthay'.

The Problem: Convert a paragraph into pig latin.

The Input: A paragraph. Words will either be separated either by a single space, or by a period and a single space. The letter 'Y' will never be the first vowel, so you won't have to handle words like psychology or xylophone. Capital letters will only appear as the first letter of a word. There will be no numbers, contractions, hyphenations, etc. - just words.

The Output: The paragraph, converted into pig latin. Note that you must maintain proper leading capitalization (Cat becomes Atcay.)

Sample Input: This is a test of the Pig Latin program. These simple phrases should just about test all conditions. Good luck.

Sample Output: Isthay ishay ahay esttay ofhay ethay Igpay Atinlay ograrnpray. Esethay implesay asesphray ouldshay ustjay abouthay esttay allhay onditionscay. Oodgay ucklay.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions