Question: Processing Arrays Consider two parallel arrays, one that stores student names and another (2D) that stores their test marks. Name Test 1 Test 2 Test


Processing Arrays Consider two parallel arrays, one that stores student names and another (2D) that stores their test marks. Name Test 1 Test 2 Test 3 Test 4 Potter 80 75 65 82 Weasley 70 62 45 78 Granger 100 100 95 100 Consider the driver program below public class Program4 { public static void main(String[] args) { String[] students = { "Potter", "Weasley", "Granger" }; int[][] marks { {80, 75, 65, 82), {70, 62, 45, 78), {100, 100, 95, 100)); int m = getMark ("Granger", students, marks, 4); displayTestAverage (marks, 2); displayTestAverage (marks,2,3); unknownMethod (students, marks); Question 5 (5 points) The method getMark() accepts a student name, the array of student names, the array of test marks, and the test number (e.g., for Test 4, the number will be 4). The method returns the student's mark on that test. If the student is not found, the method returns -1. The code is shown below. However, it contains one major error. Indicate the statement that contains the error then write the correct statement. public static int getMark (String s, String[] std, int[] [] arr, int test) { int x = -1; for (int index = 0; index
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
