Está en la página 1de 1

package pr1_semana2;

import java.util.Scanner;
public class If_Anidado {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int nota;
String Nombre;
char sexo;
String Status;
System.out.print("Ingrese el nombre del alumno: ");
Nombre = input.next();
System.out.print("Ingrese Nota: ");
nota = input.nextInt();
System.out.print("Ingrese el sexo(F o M): ");
sexo = input.next().charAt(0);
if (nota>=90)
Status = "Sobresaliente";
else if (nota>=80)
Status = "Muy Bueno";
else if (nota>=70)
Status = "Bueno";
else if (nota>=60)
Status = "Regular";
else
Status = "Reprobado";
System.out.printf("--------------RESULTADO-------------\n");
System.out.printf("Nombre: %s\nsexo: %c\nnota: %d\nStatus: %s", Nombre,s
exo,nota,Status);
}
}

También podría gustarte