Pseudo Code and Java code
Design and code a swing GUI to translate TEXT that is input in English to pig latin. you can assume that the sentence contains no punctuation . The rules for Pig Latin are as follows:
a. For words that begin with consonants, move the leading consonant to the end of the word and add "ay." Thus, "ball" becomes "allbay"; "Button" becomes "uttonbay" and so forth.
b. For words that begin with vowels, add"way" to the end of the word. Thus, "all" becomes "allway' "one" becomes" onway"; and so forth.
Use FlowLayout with JTextArea for the source text and a separate JTextArea for the translated text. Add a JButton with an event to perform the translation. A sample application is shown next with the text translated to pig latin.
to parse the source text, note that you can use the Scanner class on a string.
12 years ago
Purchase the answer to view it

- piglatingui.zip