/* program to check user's memory --> here two phrases are entered, then check against the ability of the user to properly remember the entire phrase */ //import classes; import javax.swing.*; public class Assignment4 extends JApplet { public void init() { // define the varibles used in this program String firstWord=""; String secondWord=""; String thePhrase=""; String testPhrase=""; //get the input data //store the data to variable firstWord = JOptionPane.showInputDialog ("Input the first half of the phrase here:"); secondWord = JOptionPane.showInputDialog ("Input the csecond half of the phrase here:"); thePhrase = (firstWord + " " + secondWord); //testing testPhrase=JOptionPane.showInputDialog ("What is the full phrase entered?"); if (thePhrase.equals (testPhrase)) { JOptionPane.showMessageDialog (null, "Yes! you got it."); } if (!thePhrase.equals (testPhrase)) { JOptionPane.showMessageDialog (null, "No! You made an error in the entry of the complete phrase!!!"); } } }