Advertisement
Guest User

For Loop Array

a guest
Sep 16th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. for (int i = 0; i < questions.length; i++) {
  2.             answer = JOptionPane.showInputDialog(questions[i][0]);
  3.             if (answer.equalsIgnoreCase(questions[i][1])) {
  4.                 JOptionPane.showMessageDialog(null, "Correct!");
  5.                 score++;
  6.             }
  7.             else {
  8.                 JOptionPane.showMessageDialog(null, "Incorrect!");
  9.                 score--;
  10.             }
  11.                
  12.            
  13.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement