I am new at java and creating my first project which is a calculator using intellij. I have created two if else statements the first one takes the average given by the user and turns it into a grade. The second one is supposed to take the grade then turn it into a gpa. i have declared String grade; and String gpa.
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 );
if (grade = A ) {
gpa = "4.0";
} else if (grade = B) {
gpa = "3.0";
}
Edit: The grade equals solution fixes the first error with the red underline but it doesn't compile. So I ended up using a switch statement instead in order to get two print statements.