Does the main method display the number of questions and the number of correct answers using the static member variables?

assignment to be modified . complete assignment in upload

import javax.swing.JOptionPane;

public class Quiz {

public static void main(String[] args) {
String question = “Which one is false about Java?n”;
question+=”A, Java is object orientetedn”;
question+=”B, Variables in Java are case sensetiven”;
question+=”C, There are for loops in javan”;
question+=”D, Java programs are shorter than Pythonn”;
question+=”E, All java programs are transformed to Java byte code during executionn”;
String answer=JOptionPane.showInputDialog(question);
while (true){
answer = answer.toUpperCase();
if (answer.equals(“D”)){
JOptionPane.showMessageDialog(null,”Correct.”);
break;
}
else if (answer.equals(“A”)||
answer.equals(“B”)||
answer.equals(“C”)||
answer.equals(“E”)){
JOptionPane.showMessageDialog(null,”Incorrect. Please try again.”);
}
else{
JOptionPane.showMessageDialog(null,”Invalid answer. Please enter A,B,C,D, or E”);
}
answer=JOptionPane.showInputDialog(question);

}
}

}

The following criteria to be included following criteria.
Does the submission include a static method “ask” that returns a String and takes a String parameter?
Does the “ask” method use “JOptionPane.showInputDialog” to ask the question provided as a parameter?
Does the “ask” method return only a valid answer converted to all upper case?
Does the submission include a static method “check” that takes two String parameters?
Does the “check” method call the “ask” method with one of its parameters?
Does the “check” method display one message for correct answers and a different message for incorrect answers?
Does the “check” method update static member variables to count the number of questions and the number of correct answers?
Does the main method call “check” with at least three different questions and answers?
Does the main method display the number of questions and the number of correct answers using the static member variables?

Last Completed Projects

topic title academic level Writer delivered