Question: You created a Quiz class that contains an array of 10 multiplechoice questions to which the user was required to respond with an A, B,
You created a Quiz class that contains an array of 10 multiplechoice questions to which the user was required to respond with an A, B, or C. At the time, you knew how to handle the user’s response if an invalid character was entered. Rerun the program now to determine whether an exception is thrown if the user enters nothing—that is, the user just presses the Enter key without making an entry.
If so, improve the program by catching the exception, displaying an appropriate error message, and presenting the same question to the user again. Save the file as QuizWithExceptionsCaught.java.
Step by Step Solution
3.45 Rating (171 Votes )
There are 3 Steps involved in it
QuizWithExceptionsCaughtjava Multiple choice quiz import javaxswing public class QuizWithExceptionsCaught public static void mainString args String qu... View full answer
Get step-by-step solutions from verified subject matter experts
