Design and code a swing gui to translate test


Discuss the below:

Q: Design and code a SWING GUI to translate test this is input in English into 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 "all bay"; "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 "oneway"; and so forth.

Use a FLOWLAYOUT with a JTEXTAREA for the source text and 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. For
example, the following code

Scanner scan = new Scanner ("foo bar zot");
While (scan.hasNext())
{
System.out.println(scan.next());
}

Will output:
foo
bar
zot

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Design and code a swing gui to translate test
Reference No:- TGS01934085

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)