Help us understand the problem. What is going on with this article?

配列の練習

More than 1 year has passed since last update.
ArrayPractice.java
package JavaStudy;
//配列の練習 配列と合計
//各科目の平均点数と生徒数を出力

public class ArrayPractice {

    public static void main(String[] args) {

        int[]Math = {45,68,97,35,44,61,0,25,97,11,100};
        int[]English = {54,79,12,65,67,59,43,81,5,98,41,20};
        int[]Science = {64,38,73,49,35,71,10,21,55,71};

        int result1 = resultAverage(Math,resultSum(Math));
        int result2 = resultAverage(English,resultSum(English));
        int result3 = resultAverage(Science,resultSum(Science));

        printResult(Math,result1);
        printResult(English,result2);
        printResult(Science,result3);
    }

    public static void printResult(int[]subject,int average) {
        System.out.println("Average score is "+ average);
        System.out.println("There are "+ subject.length +" students");
    }

    public static int resultSum(int[]subject) {
        int sum = 0;
        for(int i =0;i < subject.length;i++) {
            sum = sum + subject[i];
        }
        return sum;
    }

    public static int resultAverage(int[]subject,int resultSum) {
        int average = 0;
        average = resultSum/subject.length;
        return average;
    }

}
sumy
Java勉強中です。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away