Skip to content

Instantly share code, notes, and snippets.

@duranangie
Created May 17, 2024 23:13
Show Gist options
  • Save duranangie/284299be4607ff1b159bbb66729805b6 to your computer and use it in GitHub Desktop.
Save duranangie/284299be4607ff1b159bbb66729805b6 to your computer and use it in GitHub Desktop.
package helloword;
import java.util.Scanner;
public class HelloWord {
public static void main(String[] args) {
//llamamos el scanner
Scanner scan = new Scanner(System.in);
//declarar variables;
double matriz[][] = new double[4][4];
double suma = 0.0;
String nombre;
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 3; j++) {
System.out.println("ingrese la nota");
matriz[i][j] = scan.nextDouble();
suma = suma + matriz[i][j];
}
matriz[i][3] = suma/3;
suma=0;
}
for (int i = 0; i < 4; i++) {
System.out.println("laa notas del alumno "+i+" son ");
for (int j = 0; j < 4; j++) {
System.out.println("la nota n " +j+ " "+ matriz[i][j]);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment