You are viewing a single comment's thread. Return to all comments →
Is there any reason why I'm not passing test case 5 and 7? I'm pretty lost.
public Student(String firstName, String lastName, int idNumber, int[] scores) { super(firstName, lastName, idNumber); this.testScores = scores; } public char calculate() { int sum = 0; int grade = 0; for (int i = 0; i < testScores.length; i++) { sum += testScores[i]; } grade = sum / testScores.length; if (grade <= 100 && grade >= 90) { return 'O'; } else if (grade < 90 && grade >= 80) { return 'E'; } else if (grade < 80 && grade >= 70) { return 'A'; } else if (grade < 70 && grade >= 55) { return 'D'; } else if (grade < 40 && grade >= 0) { return 'T'; } else return Character.MIN_VALUE; }
}
Seems like cookies are disabled on this browser, please enable them to open this website
Day 12: Inheritance
You are viewing a single comment's thread. Return to all comments →
Is there any reason why I'm not passing test case 5 and 7? I'm pretty lost.
}