Pig Latin Console Pig Latin Console hadoop hadoop

Pig Latin Console


You've got a number of problems there. First of all, your definition of the problem:

the instructions were first consonant is removed from the front of the word

That is precisely what you have done. strength does become trengths if you move the first consonant. You need to change your definition to all leading consonants up to the first vowel. Also, what do you do in the case of eagle? Does it become eagleay? Your instructions don't specify how to deal with a leading vowel.

This is another problem

vowels = word.Substring(0,1);  // This will overwrite your vowel array with the first letter

Don't worry about writing real code just yet, write some pseudo-code to work out your logic first. @Chris's comment about looking for the first vowel is a good one. Your pseudo code may look something like:

Check if word begins with consonant{    If so, look for index of first vowel    Take substring of word up to first vowel.    Append it to end}Otherwise{    Deal with leading vowel}