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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!