using arrays or Arraylist in java language Write the method named examScore(). * * The "key" list contains the correct answers * to an exam, like ["a", "a", "b", "b"]. The "answers" * list contains a student's answers, with "?" representing * a question left blank. The two lists are not empty and * are the same length. Return the score for this list * of answers, giving +4 for each correct answer, -1 for * each incorrect answer, and +0 for each blank answer. * * Examples: * examScore(["a", "a", "b", "b"], ["a", "c", "b", "c"]) returns 6 * examScore(["a", "a", "b", "b"], ["a", "a", "b", "c"]) returns 11 * examScore(["a", "a", "b", "b"], ["a", "a", "b", "b"]) returns 16 * * @param key a list of correct answers to an exam. * @param answers the student's answers to the exam. * @return the score as described above

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 18RQ
icon
Related questions
Question

using arrays or Arraylist in java language

Write the method named examScore().
*
* The "key" list contains the correct answers
* to an exam, like ["a", "a", "b", "b"]. The "answers"
* list contains a student's answers, with "?" representing
* a question left blank. The two lists are not empty and
* are the same length. Return the score for this list
* of answers, giving +4 for each correct answer, -1 for
* each incorrect answer, and +0 for each blank answer.
*
* Examples:
* examScore(["a", "a", "b", "b"], ["a", "c", "b", "c"]) returns 6
* examScore(["a", "a", "b", "b"], ["a", "a", "b", "c"]) returns 11
* examScore(["a", "a", "b", "b"], ["a", "a", "b", "b"]) returns 16
*
* @param key a list of correct answers to an exam.
* @param answers the student's answers to the exam.
* @return the score as described above.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Arrays
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