Question: Write a program that grades multiple-choice quizzes as follows * Ask the user how many questions are in the quiz. . Ask the user to
Write a program that grades multiple-choice quizzes as follows * Ask the user how many questions are in the quiz. . Ask the user to enter the key (that is, the correct answers). There should be one answer for each question in the quiz, and each answer should be a lower-case letter. They can be entered on a single line, e.g., abbacdeacb might be the key for a 10-question quiz. You will need to store the key in an character array. Read the input as a String (using the nextLineO method of Scanner) and store each character in the key character array. Remember accessing each character of a String can be done with the charAtO method Ask the user to enter the answers for the quiz to be graded. As for the key, these can be entered on a single line. Again there needs to be one answer character for each question Note that these answers do not need to be stored in an array; each answer character can simply be compared to the key as it is processed When the user has entered all of the answers to be graded, print the number correct and the percent correct. When this works, add a loop so that the user can grade any number of quizzes with a single key After the results have been printed for each quiz, ask "Grade another quiz? (y)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
