Está en la página 1de 1

/*

* To change this license header, choose License Headers in Project Properties.


* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package domApli;

import biblioteca.LE;
import java.awt.Color;

/**
* Ingresar y alamcenar las tres notas de todos los alumnos de un salón de
* clase. Mostrar el promedio eliminando la menor nota.
*
* @author usuario
*/
public class Prg16 {

public static void main(String arg[]) {

int numAlu = LE.leerInt("Ingrese el total de alumnos");

double notas[][] = new double[numAlu][3];

// Ingreso de datos
for (int i = 0; i < numAlu; i++) {
// notas[i][0] = LE.leerDouble("Ingresa nota de práctica del alumno
" + (i + 1));
// notas[i][1] = LE.leerDouble("Ingresa nota de parcial del alumno "
+ (i + 1));
// notas[i][2] = LE.leerDouble("Ingresa nota de final del alumno " +
(i + 1));

for (int j = 0; j < 3; j++) {


notas[i][j] = LE.leerDouble("Ingresa nota " + (j+1) + " del alumno
" + (i + 1));
}

// Mostrar datos
String datos = "";
double menor, prom;
for (int i = 0; i < numAlu; i++) {
menor = Math.min(notas[i][0], Math.min(notas[i][1], notas[i][2]));
//menor = Math.min(notas[i][0], notas[i][1]);
//menor = Math.min(menor, notas[i][2]);

prom = (notas[i][0] + notas[i][1] + notas[i][2] - menor) / 2;


prom = Math.round(prom);

datos = datos + notas[i][0] + " " + notas[i][1] + " "


+ notas[i][2] + "\t" + prom + "\n";
}
LE.mostrarInformacion("Notas", "Practica - parcial - final - promedio",
datos, "Fin", Color.cyan);

}
}

También podría gustarte