package homework;
import java.util.Scanner;
public class GradeIf {
public static void main(String[] args){
double score;
System.out.println("Enter an int value:");
Scanner sc=new Scanner(System.in);
while(sc.hasNextDouble())
{
score=sc.nextDouble();
if(score>=85)
System.out.println("A");
else if(score>=70&score<85)
System.out.println("B");
else if(score>=60&score<70)
System.out.println("C");
else if(score<60)
System.out.println("D");
}sc.close();
}
}
第6周作业2-IF语句大显身手之成绩判断
最新推荐文章于 2022-05-26 15:20:20 发布