announcements‎ > ‎

2015-10-28 HW14

posted Oct 28, 2015, 10:19 AM by Samuel Konstantinovich   [ updated Oct 28, 2015, 10:19 AM ]
Pig latin:

Homework has 3 parts:
1.  Write a function
String pigLatin(String s) -> convert the word s into the pig-latin version. 
You will handle words with punctuation later!

2. Write a main that will open a text file words.txt in the format:
fish
bob
abby
under
...
wordN
It will print all of the words, after running the pig latin function on each one. 
ish-fay
ob-bay
abby-hay
under-hay
...
wordN-ay

3. Allow your main to take in a text file story.txt 
It will convert each word in the story to pig latin and keep all formatting.
3a. First ignore formatting and punctuation. Just make it work with many lines of many words per line.
3b. Now make your pig latin function handle punctuation
3c. Now make your main handle new lines properly.


Comments