Question: StudentScores.java Answerkey.txt ClassAnswers.bct The following program provides practice with Strings, arrays and ArrayLists, passing parameters to methods and returning values from methods, iterating over lists,

 StudentScores.java Answerkey.txt ClassAnswers.bct The following program provides practice with Strings, arraysand ArrayLists, passing parameters to methods and returning values from methods, iteratingover lists, searching for and sorting lists, parallel lists, equals vs. ==,

StudentScores.java Answerkey.txt ClassAnswers.bct The following program provides practice with Strings, arrays and ArrayLists, passing parameters to methods and returning values from methods, iterating over lists, searching for and sorting lists, parallel lists, equals vs. ==, and attention to detailed instruction. It requires methods invoking other methods and program design. The program can be built as a top down design, but the instructions call for a bottom up build with frequent testing of built components. Consider a system for processing student test scores. Write a program "StudentScores" as follows: Data: An ArrayList of String[] references named classAnswers. This list will reference a list of arrays, one for each student answer sheet. An ArrayList of String references named answers. The list will hold A single students answers to a multiple choice test and will be created inside addAnswers method. An ArrayList of String references named key. The list will hold answers to multiple choice questions. An ArrayList of String references named student. The list will hold student names. Each student will have a corresponding list of answers. The position of the student name in the student list will parallel the position of his answers in the answers list. Methods: setKey - accepts ArrayList key, reads from a file called Answerkey.txt. Fills the key list with a known number of answers from the file. addAnswers - accepts classAnswers and student as arguments. Reads from a falie called ClassAnswers.txt. The file will contain a student name(last, first), add that name to the student list. Then it will contain a value that represents the size of the String[] that will hold all of that students answers. Create a String[] of that size and read in that number of answers into the array. Finally put that array into the classAnswers ArrayList. This file will continue this pattern for every student in the course. The answers are represented as strings of length one with an omitted answer being presented by a string containing a single question mark("?"). These answers are stored in the list in which the position of the answer corresponds to the question number on the test (question numbers start at 0). getScore - accepts an int, the ArrayList of classAnswers, and the ArrayList key. Method retrieves the corresponding set of student answers which are in the same indexed position of answers list. A student's score on the test is computed by comparing the student's answers with the corresponding answers in the answer key for the test. One point is awarded for each correct answer and % of a point is deducted for each incorrect answer. Omitted answers (indicated by "?") do not change the student's score. printList - accepts ArrayLists classAnswers, student, and key as arguments. Method iterates thru student list, getting each students name.getScore method is called for each returning name. The returning score is compared to a default high score and its value and the student name are recorded. At the end of the loop, the high score stored and the name stored are printed. (setting high score default to Double.MIN_VALUE and student name with high score as default empty string may help.) student 0 1 2 3 4 Franklin, James Green, Jane Irving, Thomas Chang, Ralph Kopparthi, Lin classAnswers reference to each students answer sheet 0x9503 OxA629 0x1927 OxB4c3 OxB932 answers (0x9503) answer sheet for student Franklin "A" "B" "E" "A" "D" "C" "?" "B" "B" "C" answers (OxA629) answer sheet for student Green "A" "B" "D" "A" "?" "B" answers (0x1927) answer sheet for student Irving "A" "C" "D" "A" "C" "B" "B" "C" key "A" "D" "A" "E" "B" "B" ClassAnswers.txt Franklin, James 11 ? ? Green, Jane 11 ABD?AC?BBBC Irving, Thomas 11 ACDEBACE BBC Answerkey.txt 11 ACDEBACE BBC Sample Output Franklin, James score:6.5 Green, Jane score: 4.0 Irving, Thomas score:11.0 Highest score: Irving, Thomas 11.0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!