Created
September 1, 2009 03:47
-
-
Save avh4/178892 to your computer and use it in GitHub Desktop.
High-Low notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JOptionPane.showInputDialog("Hello <Name>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String answer = JOptionPane.showInputDialog("Hi, what's your name?"); | |
JOptionPane.showInputDialog(answer + " doesn't know anything about computer programming."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String yourPassword = JOptionPane.showInputDialog("Enter Your Password"); | |
if (yourPassword.equals("secret password")) | |
{ | |
JOptionPane.showInputDialog("You got the secret password!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int secretNumber = new Random().nextInt(100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int guesses = 0; | |
guesses = guesses + 1; | |
JOptionPane.showInputDialog("It took you " + guesses + " tries to guess my number."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment