java-Enter a grade from the keyboard and judge the grade corresponding to the grade

code show as below:

/*
  Enter a grade from the keyboard and judge the grade corresponding to the grade
*/
import java.util.Scanner;
class Demo8 
{
public static void main(String[] args) 
{
Scanner sc=new Scanner(System.in);
System.out .println("Please enter a grade:");
int score=sc.nextInt();
if(score>=90&&score<=100)
System.out.println("A");
else if(score>=80&&score< 90)
System.out.println("B");
else if(score>=70&&score<80)
System.out.println("C");
else if(score>=60&&score<70)
System.out.println( "D");
else
System.out.println("E");
}
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324532338&siteId=291194637