Last active
April 20, 2024 02:24
-
-
Save breshman/572e4070c44d8e0fe96cdebfe3ef03c7 to your computer and use it in GitHub Desktop.
java PC1 UTP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
double promedio, pc1, pc2, pc3, exf; | |
String nombre, especialidad; | |
Scanner input = new Scanner(System.in); | |
System.out.println("Ingrese el nombre: "); | |
nombre = input.nextLine(); | |
System.out.println("Ingrese la especialidad: "); | |
especialidad = input.nextLine(); | |
System.out.println("Ingrese la nota1: "); | |
pc1 = input.nextDouble(); | |
System.out.println("Ingrese la nota2: "); | |
pc2 = input.nextDouble(); | |
System.out.println("Ingrese la nota3: "); | |
pc3 = input.nextDouble(); | |
System.out.println("Ingrese la nota de examen final: "); | |
exf = input.nextDouble(); | |
promedio = (pc1 + pc2 + pc3 + exf) / 4; | |
if (promedio >= 12) { | |
System.out.println("APROBADO"); | |
} else { | |
System.out.println("DESAPROBADO "); | |
} | |
String nivelMensaje = ""; | |
if (promedio <= 20 && promedio >= 17) { | |
nivelMensaje = "EXCELENTE"; | |
} else if (promedio <= 16 && promedio >= 14) { | |
nivelMensaje = "BUENO"; | |
} else if (promedio <= 13 && promedio >= 11) { | |
nivelMensaje = "REGULAR"; | |
} else if (promedio <= 10 && promedio >= 5) { | |
nivelMensaje = "MALO"; | |
} else if (promedio <= 5) { | |
nivelMensaje = "PESIMO"; | |
} | |
System.out.println("\n"); | |
System.out.println(":::::::::BOLETA DE VENTA:::::::::"); | |
System.out.println("NOMBRE: " + nombre); | |
System.out.println("ESPECIALIDAD: " + especialidad); | |
System.out.println("PROMEDIO: " + promedio); | |
System.out.println("NIVEL: " + nivelMensaje); | |
System.out.println("::::::::::::::::::::::::::::::::::"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment