CS 1102 Unit 2 Programming Assignment Solution
CS 1102 Unit 2 Programming Assignment Solution
The quiz question, answers, and choice for correct answer should be unique for each submission. Here is
an example.
import javax.swing.JOptionPane;
while (true) {
answer = answer.toUpperCase();
if (answer.equals("A")) {
JOptionPane.showMessageDialog(null,"Correct!");
break;
JOptionPane.showMessageDialog(null,"Incorrect. Please
try again.");
} else {
JOptionPane.showMessageDialog(null,"Invalid answer.
Please enter A, B, C, D, or E.");
}
}