Explorar el Código

Ветвь создана

Вероника hace 8 años
padre
commit
b65abca194
Se han modificado 1 ficheros con 9 adiciones y 1 borrados
  1. 9 1
      src/javaapp1/Average.java

+ 9 - 1
src/javaapp1/Average.java

@@ -13,7 +13,7 @@ import java.io.*;
 import java.util.Scanner;
  
 class Average{
-public static void main(String args[]) throws IOException {
+/*public static void main(String args[]) throws IOException {
     Scanner in = new Scanner(System.in);
     int n;
     double sum = 0.0;
@@ -24,5 +24,13 @@ public static void main(String args[]) throws IOException {
     sum += t;
     }
     avg = sum / n;
+    }*/
+
+public double averageMark(double[] marks){
+    double sum = 0.0;
+    for (int i = 0; i < marks.length; i++){
+        sum += marks[i];
     }
+    return sum/marks.length;
+}
 }