I'm working on this project for my computer science class that tells you what grade you need to get on the final to get an A in the class. I'm working on the method that finds the grade you need to get, but it keeps printing out 15.
Does anyone know what I'm doing wrong? The issue is not due to int division.
public int gradeNeeded() {
int sumSum = 0;
double newOverall = 0;
int i = 0;
for (int j = 0; j < sumGrades.length; j++) {
sumSum += sumGrades[j];
}
while (newOverall < 90) {
sumSum += i;
double sumAverage = ((double) sumSum / (sumGrades.length + 1));
newOverall = (this.getFormAverage() * .25) + (sumAverage * .75);
i++;
}
return i;
}