You are viewing a single comment's thread. Return to all comments →
public static List<Integer> gradingStudents (List<Integer> grades) { List<Integer> roundedGrades = new ArrayList<>(); for (int grade : grades) { if (grade >= 38) { int nextMultipleOf5 = ((grade / 5) + 1) * 5; if (nextMultipleOf5 - grade < 3) { roundedGrades.add(nextMultipleOf5); } else { roundedGrades.add(grade); } } else { roundedGrades.add(grade); } } return roundedGrades;
} }
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
} }