Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

math456 Group Title

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

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. math456 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    @Hero @snark @kropot72 @Mertsj

    • 2 years ago
  2. math456 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    @cwrw238

    • 2 years ago
  3. msmithhnova Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    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

    • 2 years ago
  4. math456 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    @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"); } }

    • 2 years ago
  5. KonradZuse Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • 2 years ago
  6. msmithhnova Group Title
    Best Response
    You've already chosen the best response.
    Medals 2

    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',

    • 2 years ago
  7. math456 Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    thank you all!!

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.