CIS 110 (11fa) - Exam #2 grading rubric NOTE: the grading rubric only reflects the "common cases" that we found among the exams. It does not reflect rare or one-off cases that we may have encountered. 1. and 2. Each question is worth 2 points with no opportunities for extra credit. 3. Each part is worth 1 point. 4. The critical part of getTotalFor is recognizing that it is an accumulation loop over the lines of the file. So at the very least you need to declare an accumulation variable, modify it inside the loop, and then return that value. For folks who did not do that and thus were not able to get the correct output, we awarded points as follows: +1 Method header +2 Correct loop condition +2 Line-based scanner +2 Correct if-statement +2 Correct check for pennkey +2 Correct check for hw If you were close to getting the correct output (in particular, updating a sum inside of the loop with nextInt), then we removed points, starting at 20, as follows: -1 Incorrect method header -1 Syntax errors -2 Didn't burn the "Problem" token -2 Didn't call nextInt() -2 Missing return statement or incorrect return statement -2 No check for hw token -2 No check for pennkehy token -2 Scanner not initialized correctly 5. We awarded points for the following parts of the mutate: +1 Correct method header +3 "For k times" loop +1 Uses a random object +1 Use a random object to generate an index +1 Use a random object on the correct range +3 Handles the edge case (end of array -> 0 index) +2 Correctly accesses arrays using arr[index] +1 Use temp varaible to save element and not overwrite it +2 Temp variable is a double +4 Correctly execute swap +1 No syntax errors Specific places where we took off points: -2 Not returning a value -1 For-loop slightly off (e.g., close but wrong bound) -1 .length has parentheses -1 Single = not == in if-statement (separate from syntax) -1 Incorrect arguments to Random object -3 Overwriting contents of variables during swap 6. Part (a) was 15 points with points awarded as follows: +1 Correct method header +2 Variable declared + initialized to hold min +2 Conditional to test new min +1 Update to min variable +2 Variable declared + initialized to hold max +2 Conditional to test new max +1 Update to max variable +2 Correct calculation of range +2 Correctly return the range Part (b) was 10 points with points awarded as follows: +1 Correct method header +2 Creation of new boolean array + with the right size +1 Loop over either returned array or input array +1 Creation of a new array of size k to hold a subset of the input array. +2 Correct index when trying to load the subset array +1 Correct assignment into the subset array +1 Boolean array gets correct value (via call to range) +1 You return the boolean array. If you used Arrays methods (in particular, copyOfRange) for this problem, that was fine.