You are to create a Pig Latin Translator that has a REPL that follows an interaction model similar to this.
Pig Latin takes the first consonant (or consonant cluster) of an English word, moves it to the end of the word and suffixes an ay, or if a word begins with a vowel you just add way to the end. For example, pig becomes ig-pay, banana becomes anana-bay, and aadvark becomes aadvark-way.
> cat
at-cay
> apple
apple-way
>exit!
oodbye-gay!
Your translator should use a loop and continue to translate words until exit! is given to the translator, at which point it will tell you goodbye and then quit.
Make it so that your translator will also detect words that are already in pig latin and translate them back into English.
> at-cay
cat
> apple-way
apple
>exit!
oodbye-gay!