I'm trying to complete a simple program using multiple methods to compute the grade of a test, yet my method will not return any letters. The IDE says that my method must return a result of type String
.
public static String getGrade1(int num1) {
if (num1 <= 100 && num1 >= 90) {
String a = "A";
return a;
} else if (num1 < 90 && num1 >= 80) {
String b = "B";
return b;
}else if (num1 < 80 && num1 >= 70) {
String c = "C";
return c;
}else if (num1 < 70 && num1 >= 60) {
String d = "D";
return d;
}else if (num1 < 60) {
String f = "F";
return f;
}
}