You are viewing a single comment's thread. Return to all comments →
private static int[] gradingStudents(int[] ar) {
int[] res = new int[ar.length]; int[] org = new int[ar.length]; int rem = 0; for (int i = 0; i < ar.length; i++) { rem = ar[i] % 10; if (rem == 1 || rem == 6) { res[i] = ar[i] + 4; if (res[i] - ar[i] < 3) { org[i] = res[i]; } else { org[i] = ar[i]; } } if (rem == 2 || rem == 7) { res[i] = ar[i] + 3; if (res[i] - ar[i] < 3) { org[i] = res[i]; } else { org[i] = ar[i]; } } if (rem == 3 || rem == 8) { res[i] = ar[i] + 2; if (res[i] - ar[i] < 3) { org[i] = res[i]; } else { org[i] = ar[i]; } } if (rem == 4 || rem == 9) { res[i] = ar[i] + 1; if (res[i] - ar[i] < 3) { org[i] = res[i]; } else { org[i] = ar[i]; } } if (rem == 5 || rem == 0) { res[i] = ar[i] + 0; if (res[i] - ar[i] < 3) { org[i] = res[i]; } else { org[i] = ar[i]; } } if (ar[i] < 38) { org[i] = ar[i]; } } return org; }
Grading Students
You are viewing a single comment's thread. Return to all comments →
private static int[] gradingStudents(int[] ar) {