CSC 111 Midterm Rubric ------------------------------------------------------------------------------------------------------ Part 1 ------------------------------------------------------------------------------------------------------ (a) 3 correct numbers 2 started at 6 but went slightly too far or not far enough 1 described how start, stop, and step work (b) 3 correct numbers 2 started at -3 but went slightly too far or not far enough 1 wrong step size or other error (c) 3 correctly identified and corrected the error 2 said something about i not being an index 1 said something about an out of range error, or described a variable name change (d) 1 said x=3 0 anything else (e) 2 identified and corrected the error 1 discussed that words was a file, not a string + 1 point for a helpful variable name change (f) 0.5 points for each correct line (rounding up) + 1 point for casting (at least two correct, with less than two additional lines) (g) 6 correct code and modified the list 5 returned/printed a list instead of modifying, or modified the element variable but not the list 4 minor error, or tried to split the list and print out every other one 3 any of the above approaches, but with an additional error 2 significant error, or good description in words but not code 1 some work towards a correct solution ------------------------------------------------------------------------------------------------------ Part 2 ------------------------------------------------------------------------------------------------------ (a) 1 boolean (b) 3 points for having a for loop 2 points for returning the index correctly 4 points for correct variable usage and indexing 3 points for correctly using helper is_capital (-2 if something similar was used) 2 points for printing "no capitals found" correctly TOTAL: 14 8-10 points for counting the number of capitals, depending on how correct the code was Common issues: -1 for printing multiple capital indices within the loop -2 for printing “no capital” many times (usually inside the loop) ------------------------------------------------------------------------------------------------------ Part 3 ------------------------------------------------------------------------------------------------------ (a) 2 correct two formal parameters, with at most one extra 1 missing one, or excess values Note: switched (a) and (b), half credit 2/4 (b) 2 correct two actual parameters (there were a few other parameters that were “actual” for other functions) 1 missing one, or excess incorrect values Note: switched (a) and (b), half credit 2/4 (c) 2 function 0 variable or blank (d) 2 points for types (int and list) + 2 points for clear explanation (building up a list of random integers) (e) 2 points for types (list and boolean) + 2 points for clear explanation (difference between True and False cases) (f) 3 correct answer (False) and clear reasoning 1 said each pair was True or False (multiple returns), or just said False, or said True but good reasoning (g) 3 correct answer (True) and clear reasoning 2 said True because 0 < 15 1 said False but correctly went through the whole loop, or said multiple True return values ------------------------------------------------------------------------------------------------------ Part 4 ------------------------------------------------------------------------------------------------------ Common mistakes: -2 minor non-generic error (hard-code) -3 no spaces before first star -1 times 2 error -1 used a list instead of string, but everything else correct -2 missing last or first line (special cases) -2 decreasing/increasing issue (usually something like 2*i instead of 2(n-i)) -3 missing the number of spaces between the two stars Common solution forms: 9 for loop and first line correct, with some progress toward counting spaces 8 for loop and first line correct, but stars not mentioned in the loop 6 for loop and a start at the rest of the code 5 no for loop, but eval and first row of stars completely correct 4 for loop and eval, but no printing ------------------------------------------------------------------------------------------------------ Part 5 ------------------------------------------------------------------------------------------------------ (a) 5 indicated the correct changes in a clear manner 4 correct changes but vague about which variables were being changed 3 minor error in table 1 indicated that the variables were swapped correctly, or other significant error (b) 5 correct explanation and code modifications 3 minor error in code (usually ordering issue) 1 explanation but no code, or significant error in explanation/code (c) 5 said Yes and demonstrated correct code 3 said Yes but minor error in code, or creative method using other types 1 said No with reasonable justification 0 answer with no justification (d) 5 said no with correct reasoning and thorough explanation 4 minor error in reasoning, or detailed explanation of how to obtain something similar with a list 3 thorough explanation of return/reassign being the only way, including ints are immutable 2 said ints are immutable + other explanation but error in reasoning 1 said it was possible with a reasonable justification 0 Yes/No with no justification (e) 1 explained why you must return a *new* string (because strings are immutable) + 4 a correct solution that uses concepts we have learned so far 3 used replace(...) correctly with assignment and return (issue: will replace all) 2 used replace(...) or a loop to build up the string, but with minor issues 1 progress towards a correct solution, or used swap like for a list (not possible) 0 used simultaneous assignment or work not on track toward a solution