-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPropio_CalculoPromedio.java
57 lines (43 loc) · 1.42 KB
/
Propio_CalculoPromedio.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package Todo_Code;
import java.util.Scanner;
public class Propio_CalculoPromedio {
public static void main(String[] args) {
try (Scanner entrada = new Scanner(System.in)) {
int mF, mC;
System.out.print("Ingrese el maximo de alumnos: ");
mF = entrada.nextInt();
System.out.print("Ingrese el maximo de notas: ");
mC = entrada.nextInt();
System.out.println("");
Double matriz[][] = new Double [mF][mC+1];
Double suma = 0.0;
for(int f=0; f<mF; f++) {
for(int c=0; c<mC; c++) {
System.out.print("Ingrese la calificacion del alumno N° " + f + ": ");
matriz[f][c]=entrada.nextDouble();
suma = suma + matriz[f][c];
}
matriz[f][mC] = suma / mC;
suma = 0.0;
System.out.println("------------------------------------------------");
}
for(int f=0; f<mF; f++) {
System.out.println("Las calificaciones del alumno N° " + f + " son: ");
System.out.println("");
for(int c=0; c<mC; c++) {
System.out.println(matriz[f][c]);
}
if (matriz[f][mC]>=4) {
System.out.println("");
System.out.println("Promedio final: " + matriz[f][mC]);
System.out.println("El alumno APROBO el curso");
}else {
System.out.println("");
System.out.println("Promedio final: " + matriz[f][mC]);
System.out.println("El alumno REPROBO el curso");
}
System.out.println("------------------------------------------------");
}
}
}
}