Create a simple applet or gui application based on this


Question: ELIZA was a program written in 1966 that parodied a psychotherapist session. The user typed sentence and the program used those word to compose a question.

Create a simple applet or GUI application based on this idea. The program will use a label to hold the program's question, a text field into which the user can type an answer, a button for the user to signal that the answer is complete, and a quit button.

The initial text for the question label should read: "What would you like to talk about?" When the user press a button, get the text from the text field. Now extract the words from the text one at a time and find the largest word of length 4 or more. Let's call this largest word X foe now. In response, create a question based on a length of the word. IF the word is length 4, the new question is: "Tell me more about X ."If the word is length 5, the new question is :" Why do you think X is important?" If the word is length 6 or more, the new question is: "Now we are getting somewhere. How does X affect you the most?" If there is no word of length 4, the new question is: "Maybe we should move on. Is there something else you would like to talk about?"

String text = " one potato two potato";

Scanner parser = new Scanner(text);

System.out.println(parser.next());

System.out.println(parser.next());

display one and potato on separate lines.)

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Create a simple applet or gui application based on this
Reference No:- TGS02457094

Now Priced at $15 (50% Discount)

Recommended (92%)

Rated (4.4/5)