I am using intellij & java to make a program that can calculate the users grade based on their input.So far I have successful gathered the input from the user by using scanner and got an average. I am using the average to print a letter grade by else if statements. But my program only prints out a letter grade for the grade F it doesn't print any other even when I enter scores that average to 90.
String grade;
if (avg >= 90.0 ) {
grade = "A";
} else if (avg >=80.0) {
grade = "B";
} else if (avg >=70.0){
grade = "C"
} else if (avg >=60.0) {
grade = "D";
} else {
grade = "F";
System.out.println("Grade is " + grade );
}
}
}
I expected the program to check all else if statements but if score has an average of 60 or higher it will not print the grade is statement and will just show the average only.