I was told to code an if statement with a scanner type but it seems that I didn't got any output
import java.util.Scanner;
public class StillTraining {
public static void main(String[] args) {
Scanner deg = new Scanner (System.in);
System.out.println("enter your score");
int score = deg.nextInt();
if (score >= 90 && score <= 100 );
System.out.println("Your score is A");
else if (score >= 80 && score > 90);
System.out.println("Your score is B");
else if (score >= 70 && score > 80);
System.out.println("Your score is C");
else if (score >= 60 && score > 70);
System.out.println("Your score is D");
else
System.out.println("Your score is F");
}
}
Aucun commentaire:
Enregistrer un commentaire