You may make a copy of a worksheet and complete this activity, or simply type your answers in any text editor.
You may work alone or with at most two other students in this course (feel free to make use of any communication channels of your choice).
Consider the sum method
/**
* Sum values in an array
*
* @param x array to sum
* @return sum of values in x
* @throws NullPointerException if x is null
*/
line 1: public static int sum(int[] x)
line 2: {
line 3: int s = 0;
line 4: for (int i=0; i < x.length; i++)
line 5: {
line 6: // s = s + x[i]; // original
line 6': s = s - x[i]; // AOR mutant
line 7: }
line 8: return s;
line 9: }
Mutation operator: AOR (Arithmetic Operator Replacement) replaces each occurrence of +, -, *, /, **, and % by each of the other operators.
For this activity, you only need to consider the given AOR mutant (line 6').
(-2.5 points) for 24 hours late (submitted after 8-Nov-2025 11am EST, by 9-Nov-2025 11am EST)
(-5 points) for 48 hours late (submitted after 9-Nov-2025 11am EST, by 10-Nov-2025 11am EST)
Making your submission available to instructor and course staff is your responsibility; if we cannot access or open your file, you will not get credit. Be sure to test access to your file before the due date.
CC-BY-NC-SA 4.0 license.