Answer to Question #148115 in Java | JSP | JSF for Thog

Question #148115
• Add a static method that asks a question until the user provides valid input.
• Call the method "ask". It should take a String parameter, and it should return a String.
static String ask(String question) {
• Remember where method definitions go: inside the class (in this case, "Quiz") but outside
all other method definitions (like "main"). It can go before or after the "main" definition.
• Ask the user the question repeatedly until the user provides a valid answer: "A", "B", "C",
"D", or "E".
• Ask the question using "JOptionPane.showInputDialog".
• Allow the user to provide a lower-case answer, and convert it to upper case.
• If the user provides an invalid answer, use "JOptionPane.showMessageDialog" to tell
1
Expert's answer
2020-12-01T08:07:09-0500
Dear Thog, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog