-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
This isn't urgent, because I can substitute another problem.
package edu.northeastern.examples.larger_non_negative;
import edu.illinois.cs.cs125.questioner.lib.Correct;
import edu.illinois.cs.cs125.questioner.lib.Wrap;
/*
* Write a method `largerNonNegative` that returns the larger of 2 `int`
* arguments, or 0 if both of the arguments are negative.
*/
@SuppressWarnings("ManualMinMaxCalculation")
@Correct(name = "Larger Non-Negative", author = "e.spertus@northeastern.edu", version = "2023.12.0")
@Wrap
public class Question {
int largerNonNegative(int first, int second) {
if (first < 0 && second < 0) { // mutate-disable-conditional-boundary
return 0;
} else if (first > second) { // mutate-disable-conditional-boundary
return first;
} else {
return second;
}
}
}This can't be validated becase changing the int literals in the first if-condition from 0 to 1 does not affect behavior.
Metadata
Metadata
Assignees
Labels
No labels