Main Method:
System.out.println("Student Name\tHigh Score\tLow Score\tAverage\t\tGrade");
for (int p = 0; p < Student.length; p++) {
System.out.println(Student[p] + "\t\t" + highGrade(studentGrades[p])
+ "\t\t" + lowGrade(studentGrades[p]) + "\t\t"
+ averageGrade(studentGrades[p]) + "\t\t" + letterGrade(p));
__________________________________________________ __________________________________________________ __________________
public static String letterGrade(double arrayIn[]) {
double avgGrade = 0.0;
for (int i = 0; i < arrayIn.length; i++) {
avgGrade += arrayIn[i];
double newavg = avgGrade / arrayIn.length;
if (newavg >= 94) {
return "A";
} else if (newavg >= 90) {
return "A-";
} else if (newavg >= 87) {
return "B+";
} else if (newavg >= 84) {
return "B";
} else if (newavg >= 80) {
return "B-";
} else {
return "F";
}
}
}
__________________________________________________ ______________________
It tells me I am missing me return statement. So Im not sure how to make my letter grades return from me if else statements. I am a beginner. Also thanks for your help!
Jason