Question: So I wanted to make a program where the user inputs a numeric grade then converts it into a letter grade but I have errors
So I wanted to make a program where the user inputs a numeric grade then converts it into a letter grade but I have errors in my if statements since it doesn't recognize the variable "grade". What are the changes should I make for the code to work?
package grades;
import java.util.Scanner;
public class Grades {
public static void main(String[] args) {
Scanner input=new Scanner (System.in);
int grade;
System.out.print("Enter the student's numeric grade:");
System.out.print(" The converted grade is: ");
if ( grade <=99 && >= 93) {
System.out.print("A");
}
else if {
if (grade <= 92 && >=87)
System.out.print("B");
}
else if {
if (grade <=86 && >= 80)
System.out.print("C");
}
else if {
if ( grade <=79 && >=70)
System.out.print("D");
}
else if {
if ( grade <=69 && >=65)
System.out.print("F");
}
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
