[25] Write a program that will translate English text into
Pig-Latin. English words are converted to Pig-Latin words according
to the following rules:
- if a word starts with a vowel, just add ay to
the end of the word. EG
- exam becomes examay
- old becomes olday
- if the word starts with a consonant, move all letters, up to the
first vowel, to the end of the word and then add ay. EG
- went becomes entway
- student becomes udentstay
- stream becomes eamstray
- all other characters should not be changed. EG the sentence
I have, in the bank, $300 in cash.
would be translated as
Iay avehay, inay ethay ankbay, $300 inay ashcay.
For purposes of this assignment, the vowels are 'a', 'e', 'i', 'o', 'u'.
The text to be translated is to be read from a file and the output should be
written to a file. The program should ask for the filenames at runtime.
BONUS [3]: When y is not the first letter of a word, it is usually
a vowel. Make necessary modifications so that if a y
is found inside a word, it is considered a vowel. Thus
syllable would be translated yllablesay not
ablesyllay but yellow would still be
ellowyay.