
algoritmos
Publicado por Emanuel (1 intervención) el 05/05/2023 03:39:50
import java.util.Scanner;
public class Ejercicio2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Ingrese la nota del examen:");
int nota = sc.nextInt();
if (nota < 5) {
System.out.println("La nota es :" + nota + " , reprueba");
} else {
if (nota >=5 && nota < 7) {
System.out.println("La nota es :" + nota + " , aprobado");
} else {
if (nota >= 7 && nota < 9) {
System.out.println("La nota es :" + nota + " , notable");
} else {
if (nota >= 9 && nota < 10) {
System.out.println("La nota es :" + nota + " , sobresaliente");
} else {
if (nota == 10) {
System.out.println("La nota es :" + nota + " , excelente");
} else {
System.out.println("La nota esta fuera de rango");
}
}
}
}
}
}
}
public class Ejercicio2 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Ingrese la nota del examen:");
int nota = sc.nextInt();
if (nota < 5) {
System.out.println("La nota es :" + nota + " , reprueba");
} else {
if (nota >=5 && nota < 7) {
System.out.println("La nota es :" + nota + " , aprobado");
} else {
if (nota >= 7 && nota < 9) {
System.out.println("La nota es :" + nota + " , notable");
} else {
if (nota >= 9 && nota < 10) {
System.out.println("La nota es :" + nota + " , sobresaliente");
} else {
if (nota == 10) {
System.out.println("La nota es :" + nota + " , excelente");
} else {
System.out.println("La nota esta fuera de rango");
}
}
}
}
}
}
}
Valora esta pregunta


-1