Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#python Write a function called pigitize that takes one parameter: infile - A file name of type string. This input file is meant for reading.

#python Write a function called pigitize that takes one parameter: infile - A file name of type string. This input file is meant for reading. The function takes the English text from the file, translates it into Pig Latin, and prints the translated text out to the screen. The rules of Pig Latin that we will be using for this assignment are as follows (source: https://en.wikipedia.org/wiki/Pig_Latin): For words that begin with consonant sounds, all letters before the initial vowel are placed at the end of the word sequence. Then, "ay" (some people just add "a") is added, as in the following examples:

"pig" "igpay" "banana" "ananabay" "trash" "ashtray" "happy" "appyhay" "duck" "uckday" "glove" "oveglay" For words that begin with vowel sounds or a silent letter, one just adds "yay" to the end. Examples are: "eat" "eatyay" "omelet" "omeletyay" "are" "areyay" The output must keep the file's linebreaks in tact. Uppercase characters and punctuation must also be taken into account. For example, if the file test.txt contains the following text: Hello! My name is example. exampleyay It is a pleasure to meet you. The output of function call pigitize( "test.txt" ) should be: ellohay ymay amenay isyay exampleyay ityay isyay ayay easureplay otay eetmay ouyay Hint - Try making little functions to do some of the smaller jobs of this program. Breaking up the problem into pieces is easier than having one function do everything.

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

How would you assess the value of an approach like this?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago