Your math teacher has asked you to write a program that grades the multiple-choice questions in a Math exam. The exam has 10 multiple-choice questions. Here are the correct answers:

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 4GZ
icon
Related questions
Question
sample run:
Enter the answers for each of the questions.
Question1:A
Question2:D
Question3:B
Question4:b
Question5:c
Question6:b
Question7:v
Enter only an A, B, C, D or a,b, c, d for each question.
Question7d
Question8:c
Question9:b
Question 10:D
You have 3 answers wrong.
You have 7 answers right.
The wrong questions are: [7, 8, 9]
The right questions are: [1, 2, 3, 4, 5, 6, 10]
You passed the exam.
Transcribed Image Text:sample run: Enter the answers for each of the questions. Question1:A Question2:D Question3:B Question4:b Question5:c Question6:b Question7:v Enter only an A, B, C, D or a,b, c, d for each question. Question7d Question8:c Question9:b Question 10:D You have 3 answers wrong. You have 7 answers right. The wrong questions are: [7, 8, 9] The right questions are: [1, 2, 3, 4, 5, 6, 10] You passed the exam.
Your math teacher has asked you to write a program that grades the multiple-choice questions in a Math exam. The
exam has 10 multiple-choice questions. Here are the correct answers:
1. A
6. B
2.D
3. B
4.B
5.C
7.A
8. B
9.C
10.D
Your program should store the correct answers shown above in a list. It should ask the student to enter her answers for
each of the 10 questions, and the answers should be stored in another list. After the student's answers have been
entered, the program should display a message indicating whether the student passed or failed the exam. (A student
must correctly at least answer 7 of the 10 questions to pass the exam.) It should then display the total number of
correctly answered questions, the total number of incorrectly answered questions. Your program must have at least the
following functions:
1. getInput(inputList)
2. checkAnswers(userlist, correctAnswerList, rightQuestions, wrongQuestions)
*. The getInput function accepts a list and asks the user to input answers to the exam and stores them in the list. You
must have an Input Validation loop: Only accept the letters A, B, C, D or a, b, c, d, as answers.
*. The checkAnswers function receives 4 parameters; the student's answers the correct answers and an empty list for the
student's right answers and an empty list for the student's wrong answers.
It compares the values in the correct answers list to the values of the student's list. It updates the student's right
answers list and the student's wrong answers list. it returns the number of correct answers to the main function.
Transcribed Image Text:Your math teacher has asked you to write a program that grades the multiple-choice questions in a Math exam. The exam has 10 multiple-choice questions. Here are the correct answers: 1. A 6. B 2.D 3. B 4.B 5.C 7.A 8. B 9.C 10.D Your program should store the correct answers shown above in a list. It should ask the student to enter her answers for each of the 10 questions, and the answers should be stored in another list. After the student's answers have been entered, the program should display a message indicating whether the student passed or failed the exam. (A student must correctly at least answer 7 of the 10 questions to pass the exam.) It should then display the total number of correctly answered questions, the total number of incorrectly answered questions. Your program must have at least the following functions: 1. getInput(inputList) 2. checkAnswers(userlist, correctAnswerList, rightQuestions, wrongQuestions) *. The getInput function accepts a list and asks the user to input answers to the exam and stores them in the list. You must have an Input Validation loop: Only accept the letters A, B, C, D or a, b, c, d, as answers. *. The checkAnswers function receives 4 parameters; the student's answers the correct answers and an empty list for the student's right answers and an empty list for the student's wrong answers. It compares the values in the correct answers list to the values of the student's list. It updates the student's right answers list and the student's wrong answers list. it returns the number of correct answers to the main function.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT