For an assignment I am supposed to write a program translating a text to pig latin, the specs for the assignment are below:
Write a program that can read or write a text using pig Latin. The user should select at the beginning if he or she wants to translate to pig Latin or from pig Latin, then the user should give the file name where the text is, and the program should translate it and save it in the pigLatinOutput.txt. The rules for pig Latin are as follows:
a)If the
string begins with a vowel, add the string �-way� at the end of the string. For example the string �eye� becomes �eye-way�.
b)If the string does not begin with a vowel, first add �-� at the end of it.
Then rotate the string one character at a time; that is, move the first
character of the string to the end of the string, and repeat this process
until the first character of the string is a vowel. Then, add the string �ay� at the end. For example the string �there� becomes �ere-thay�. For this program consider that �y� is also a vowel.
c)If the string is numeric just add the string �-way� at the end of it.
I wrote out a program for it, but I get an incredible number of errors when I try to run it. I'm completely lost, this is a really complicated problem for me and I'm not sure what I should do from here. Any help would be greatly appreciated.
[ edited to break apart long unbroken lines and to remove the evil tab character -ds ]
[ November 17, 2003: Message edited by: Dirk Schreckmann ]