Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

Need help!! Write an interactive program that reads lines of input from the user and converts each line into "Pig Latin." Pig Latin is English with the initial consonant sound moved to the end of each word, followed by "ay". Words that begin with vowels simply have an "ay" appended. For example, the phrase The deepest shade of mushroom blue would have the following appearance in Pig Latin: e-Thay eepest-day ade-shay of-ay ushroom-may ue-blay

Computer Science
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SIGN UP FOR FREE
get Input for each word in input if first letter is vowel print word and 'ay' else find first vowel print (from vowel to end) + (from start to vowel) + 'ay' in python this would be easy using slicing, other languages likely similar concepts can be used

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

@msmithhnova like this? import java.util.*; public class PigLatin { public static void main(String [] args) { System.out.println("Type a word "); vowel = ("a,e,i,o,u"); int v = vowel; if(word = "v") { System.out.println("ay"); } else ("find vowel") { } System.out.println("from vowel to end" + "from start to vowel" + "ay"); } }
You will basically need to delete the first character of a string, and then add ay to the back as well as the first letter.
I'm not familiar with java but the code below will work in python 2.x, not 3.x. It doesn't take into account uppercase vowels, punctuation etc vowels = ['a', 'e', 'i', 'o', 'u'] text = raw_input("Enter some text to convert to piglatin: ") word_list = text.split() for word in word_list: if word[0] in vowels: print word + "-ay", else: index = -1 for char in vowels: i = word.find(char) if i > -1 and index == -1: index = i elif i > -1 and i < index: index = i print word[index:] + '-' + word[:index] + 'ay',
thank you all!!

Not the answer you are looking for?

Search for more explanations.

Ask your own question