Você está na página 1de 1

import java.util.

Scanner;

public class Main {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

//Conversor de notas
//00 - 09 = F
//10 - 29 = E
//30 - 49 = D
//50 - 69 = C
//70 - 89 = B
//90 - 100 = A

int nota;
String Nome;

do{
do {
System.out.println(("___________________________________"));
System.out.println("Digite *Pare* para sair");
System.out.println("Qual o nome do(a) aluno(a)?");
Nome = scanner.nextLine();
}while(Nome.isBlank());

if(Nome.isBlank()) {
System.out.println("Digite um nome válido");
return;

}if (Nome.equalsIgnoreCase("Pare")) {
System.out.println("Obrigado");
return;

}else {
System.out.println("Qual a nota numérica do(a) " + Nome + "?");
nota = scanner.nextInt();
scanner.nextLine();

switch (nota / 10) {


case 10, 9 -> System.out.println("A nota do(a) " + Nome + " é A");
case 8, 7 -> System.out.println("A nota do(a) " + Nome + " é B");
case 6, 5 -> System.out.println("A nota do(a) " + Nome + " é C");
case 4, 3 -> System.out.println("A nota do(a) " + Nome + " é D");
case 2, 1 -> System.out.println("A nota do(a) " + Nome + " é E");
case 0 -> System.out.println("A nota do(a) " + Nome + " é F");
default -> System.out.println("Digite uma nota válida");
}
}
}while(!Nome.equalsIgnoreCase("Pare"));
}
}

Você também pode gostar