Lab
Exercise Three
In this exercise you are
to write a main class do the following:
Write a while loop to input words (one word to a line) using JOptionPane (see the Scanner Example to input with a loop) and assign it to a String variable
Terminate the loop when the user clicks on the cancel button of the JOptionPane window
Add code to accumulate the words in a String variable out with a '\n' between the Strings and display out in a JTextArea
Add code so that if the word "Alabama" is input it will not be included in the variable out
Add code to input a word and a number (int) separated by a space on each line. Assign the word to a String variable and the number to an int variable. Accumulate the words into out as above and accumulate the numbers in an in variable sum.
After the while loop add (concatenate) the out and sum variable and assign the result into out.
Display out in a JTextArea.