Pig Latin String Assignment
Bucaria Rules
1) Starts with a vowel (a,e,i,o,u,y) - add "way" - Example - - Awesome -> Awesomeway and I -> I way
2) Starts with two consonants - take the first two letters off the front of the string and append them to the end of the string and add "ay". Example - child - ildchay
3) Starts with consonant followed by a vowel - Take the last letter off and put it at the beginning of the string and then add on "ay". Example - Happy -> yhappay
4) Starts with three consonants - similar to two consonants - Example - three-> eethray
Grading
80 - Get convert to work for all of the above rules.
85 - Enter ten distinct words from the keyboard and print their Pig Latin equivalent...test out my and why and I...test all cases.
85++ -
- Add another PigLatin dialect - make sure they are given the rules and get to choose
- Process a sentence using the StringTokenizer class
import java.util.StringTokenizer;
StringTokenizer phrase=new StringTokenizer(sentence); //sentence is a String read from the keyboard
String token;
while(phrase.hasMoreTokens())
{
token=phrase.nextToken();
.......
}
HAVE FUN and BE CREATIVE!!!!!