Pig Latin
Problem 7 Division I / II 6 Points
Problem Statement
Write a program to translate English text to Pig Latin. The rules for translating English to Pig Latin are:
  1. If a word begins with a vowel, add the letters 'pay' to the end of the word. Thus, "open" becomes "openpay" and "art" becomes "artpay".  For this program, vowels are a, e, i, o, u, y, and w.
  2. If a word begins with one or more consecutive consonants, the entire consonant block is moved to the end of the word, and the letters 'ay' are added after it. Thus, "paper" becomes "aperpay", "stretch" becomes "etchstray", and "doesn't" becomes "oesn'tday".
Notice that any punctuation marks should remain unaffected by the translation. If a word in English is capitalized, the Pig Latin word should also be capitalized. Be sure to duplicate the word and line division during translation.
Program Input
The input file PROG07.IN will contain a series of lines of English words. The maximum length of a line is 80 characters. There will be no blank lines and no numeric digits in the file.
She brought fifteen small animals into the
courtyard, but she didn't know they were going
to run away and hide.  We spent all afternoon
chasing and catching those animals!
Program Output
The program must write the Pig Latin translation of the input file to the output file PROG07.OUT, keeping the same number of words per line as the input file.
Eshay oughtbray ifteenfay allsmay animalspay intopay ethay
ourtyardcay, utbay eshay idn'tday owknay eythay werepay oinggay
otay unray andpay idehay.  Wepay entspay allpay afternoonpay
asingchay andpay athcingcay osethay animalspay!