Professional Documents
Culture Documents
The quiz questions, answers, and choices for correct answer should be unique for each submission. Here
is an example.
import javax.swing.JOptionPane;
while (true) {
answer = answer.toUpperCase();
nQuestions++;
if (answer.equals(correctAnswer)) {
JOptionPane.showMessageDialog(null,"Correct!");
nCorrect++;
} else {
}
}
check(question,"A");
check(question,"B");
check(question,"C");
JOptionPane.showMessageDialog(null,nCorrect+" correct out of
"+nQuestions+" questions");