Difference between revisions of "Mad Lib"

From CompSciWiki
Jump to: navigation, search
Line 2: Line 2:
  
 
|ProblemName=Mad Lib
 
|ProblemName=Mad Lib
|Problem=
+
|Problem=Lets create a program which takes some text input from a user and then makes a Mad Lib out of it.
 +
We're going to look at making this application using JOptionPane with both input and output.
  
 
|SolutionCode=<pre>
 
|SolutionCode=<pre>
Line 24: Line 25:
 
//      plural noun    country        verb    noun
 
//      plural noun    country        verb    noun
 
 
System.out.println("The " + pluralNoun + " in " + country + " like to " + verb + " the " + noun + ".");
+
JOptionPane.showMessageDialog("The " + pluralNoun + " in " + country + " like to " + verb + " the " + noun + ".");
System.out.println("End of processing.");
+
 
}
 
}
 
}
 
}

Revision as of 17:08, 5 April 2010

Back to the Program-A-Day homepage

Problem

Lets create a program which takes some text input from a user and then makes a Mad Lib out of it. We're going to look at making this application using JOptionPane with both input and output.

 

...by students

An image or By Students section

Solution

The solution...

Code

Solution Code

Back to the Program-A-Day homepage