Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 5.2 (design, piglatin.py). Before attempting to code this problem, create a file design that contains some analysis of how you think the problem will

image text in transcribed
Exercise 5.2 (design, piglatin.py). Before attempting to code this problem, create a file design that contains some analysis of how you think the problem will be solved. Examples include but are not limited to: a flowchart of events in the program, pseudocode, or a step-by-step process written in plain English. If you choose to scan your design, please make sure that it is legible. Write a program that translates a file from English to pig latin. The rules for pig latin are as follows: For a word that begins with consonants, the initial consonant or consonant cluster is moved to the end of the word and "ay" is added as a suffix: "happy""appyhay" ."glove""oveglay For words that begin with vowels, you add "way" to the end of the word: egg""eggway "inbox""inboxway For your program, you must write a function that takes in one individual word and returns the translation to pig latin. Write another function that takes a string, which may be sentences (may contain the characters "a-zA-Z 20" and space), and returns the translation of the sentence to pig latin. Strip out any punctuation. For example, "Hello, how are you?" would translate into "elloHay owhay areway ouyay The user must be able to specify the filename for the file to be translated and the filename that the program should write to. For example: CSE/IT 1071 Lab 10 Review and Markov Chain ??cat test.txt 2 Hello, how are you? ? $ python3 piglatin.py Enter English filenane >>> test.txt s Enter filenane to vrite to >>> test piglatin.txt s Done $ cat test.piglatin.txt s elloHay owhay arevay ouyay

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

MFDBS 91 3rd Symposium On Mathematical Fundamentals Of Database And Knowledge Base Systems Rostock Germany May 6 9 1991

Authors: Bernhard Thalheim ,Janos Demetrovics ,Hans-Detlef Gerhardt

1991st Edition

3540540091, 978-3540540090

More Books

Students also viewed these Databases questions

Question

Q .1. Different ways of testing the present adulterants ?

Answered: 1 week ago

Question

Q.1. Health issues caused by adulteration data ?

Answered: 1 week ago

Question

1. Traditional and modern methods of preserving food Articles ?

Answered: 1 week ago

Question

What is sociology and its nature ?

Answered: 1 week ago