Skip to content

Instantly share code, notes, and snippets.

@breshman
Last active April 20, 2024 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save breshman/572e4070c44d8e0fe96cdebfe3ef03c7 to your computer and use it in GitHub Desktop.
Save breshman/572e4070c44d8e0fe96cdebfe3ef03c7 to your computer and use it in GitHub Desktop.
java PC1 UTP
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