PLEASE DO IT IN C# OR PYTHON!
Write a FUNCTION which takes in a String as a parameter and returns a Pig Latin version of that string. The program should be able to :
1) handle punctuation
2) Ignore numbers (i.e. if “500” is passed in, “500” is passed back)
3) Handle multiple sentences
Pig Latin translation is simply taking the first letter of a “word” and appending that letter to the end of the word with “ay” added to the end as well. Example:
“Alex, how did you do question 21?” should translate to “lexAay, owhay idday ouyay oday uestionqay 21?”
Here is the answer..
CODE:
s=input("")
l=s.split(" ")
s=""
for word in l:
index=0
for j in word:
if(j>='A' and j<='Z' or j>='a' and j<='z'):
print("",end="")
else:
index=word.index(j)
break
try:
a=int(word[0:index-1])
s+=word+" "
except ValueError:
if(index):
s+=word[1:index]+word[0]+"ay"+j+" "
else:
s+=word[1:]+word[0]+"ay"+" "
print(s)
OUTPUT:

If you have any doubts please COMMENT...
If you understand the answer please give THUMBS UP...
PLEASE DO IT IN C# OR PYTHON! Write a FUNCTION which takes in a String as...
Please use PYTHON3 to Create a program that translates English into Pig Latin. The function will take the first letter of each word in the sentence only if it’s a not a vowel, and place it at the end of the word followed by “ay”. Your program must be case insensitive. You must write the function translate() that takes in a single English word and returns its Pig Latin translation. Remember translate must take only one word as input. #############################################################...
**IN JAVAAssignment 10.1 [95 points]The WordCruncher classWrite the Java code for the class WordCruncher. Include the following members:A default constructor that sets the instance variable 'word' to the string "default".A parameterized constructor that accepts one String object as a parameter and stores it in the instance variable. The String must consist only of letters: no whitespace, digits, or punctuation. If the String parameter does not consist only of letters, set the instance variable to "default" instead. (This restriction will make...
Correct the syntax errors to allow the code to pass all of the
provided doctests.
You may have heard of "Pig Latin," a set of rules for modifying regular English to render it unintelligible to those who do not know the rules. This problem asks you to fix a function that will convert an English word to Pig Latin The rules for converting a word to Pig Latin are as follows: 1. If the word starts with a vowel, add...
In C
Sixth: Pig Latin (10 Points) For this part of the assignment, you will need to write a program that reads an input string representing a sentence, and convert it into pig latin. We'll be using two simple rules of pig latin: 1. If the word begins with a consonant then take all the letters up until the first vowel and put them at the end and then add "ay" at the end. 2. If the word begins with...
Pig Latin Translator in Java The goal here is to read in the characters stored in a text file and create a second text file that contains the original text but with every word converted to “Pig-Latin.” The rules used by Pig Latin are as follows: • If a word begins with a vowel, just as "yay" to the end. For example, "out" is translated into "outyay". • If it begins with a consonant, then we take all consonants before...
Pig Latin Translator in Java The goal here is to read in the characters stored in a text file and create a second text file that contains the original text but with every word converted to “Pig-Latin.” The rules used by Pig Latin are as follows: • If a word begins with a vowel, just as "yay" to the end. For example, "out" is translated into "outyay". • If it begins with a consonant, then we take all consonants before...
Please complete the following: Write a Python script to do the following: 1. Ask the use to enter several sentences, one at a time in a loop). To end the sentence entry, the user enters a blank (empty) sentence. 2. Extract each word from each sentence and put it in a list. This will require at least one loop to go through each sentence in the list. It is up to you how you want to get the words in...
Write a python function score_formatter() that takes one parameter, which is a formatted string that contains information about the score received by a student in a particular subject. The function analyzes the string and returns a reformatted string for the score. You will need to use the function re.sub that is discussed in the lecture notes. If the string does not match the pattern, the function returns the string "error". The input string is always given in the format specified...
Write a function palcheck (char word II) which takes a C-style string word (or a C++ string word if you wish) and returns or false depending on whether or not the string is a palindrome. (A palindrome is a string which reads the same backwards and forwards. Some classic example of palindromes are radar, racecar, toot, deed, bib, civic, redder and madam.) Use your function from part (a) in a complete C++ program which, for each small letter 'a' through...
how do i write a Python program in function. calc_fuel which takes two input parameters: distance fuel_consumption. The function should calculate : fuel_needed = distance * fuel_consumption / 100. The function should then return fuel_needed. Now add the following lines at the end of main(): distance = 500 fuel_rate = 8 fuel = get_fuel(distance, fuel_rate) print(“Fuel needed is“, fuel)