java : Calclular notas por cada nombre de alumno
/*
* 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 javaapplication4;
import javax.swing.JOptionPane;
/**
*
* @author Clases
*/
public class JavaApplication4 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
float notas[][]=new float[3][4];
String nombres[]=new String[3];
float suma=0;
for(int i=0;i<3;i++){
suma=0;
nombres[i]=JOptionPane.showInputDialog("Ingresar Nombre");
for(int j=0;j<4;j++){
notas[i][j]=Float.parseFloat(JOptionPane.showInputDialog("Ingresar Notas"));
suma=suma+notas[i][j];
}
JOptionPane.showMessageDialog(null,"El Promedio de "+ nombres[i] +" es "+(suma/4));
}
}
}
Copyright : Inacap
Copyright : Inacap