Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String guess = "java";
- String answer;
- answer = JOptionPane.showInputDialog(null, "Guess what i am");
- if ("java".equals(answer))
- {
- JOptionPane.showMessageDialog(null, "you guessed right the first time");
- }
- else
- {
- answer = JOptionPane.showInputDialog(null, "Take a second guess");
- if ("java".equals(answer))
- {
- JOptionPane.showMessageDialog(null, "you guessed right the second time");
- }
- else
- {
- answer = JOptionPane.showInputDialog(null, "take a third guess");
- if("java".equals(answer))
- {
- JOptionPane.showMessageDialog(null, "you got it right on your 3rd guess");
- }
- else
- {
- JOptionPane.showMessageDialog(null, "3rd Wrong guess\nClue: i have 3 editions");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement