解答例 - j2.lesson02_2.ExamRecord2Action

package j2.lesson02_2;

public class ExamRecord2Action {
    public static void main(String[] args) {
        ExamRecord2[] rec = new ExamRecord2[4];

        rec[0new ExamRecord2("Taro"5090100);
        rec[1new ExamRecord2("Hanako"703080);
        rec[2new ExamRecord2("Kenji"605070);
        rec[3new ExamRecord2("Aya"4010090);

        for (int i = 0; i < rec.length; i++) {
            rec[i].show();
        }
        
        System.out.println("全員の数学の平均点 = " + ExamRecord2.averageMath(rec));
        System.out.println("全員の国語の平均点 = " + ExamRecord2.averageJapanese(rec));
        System.out.println("全員の英語の平均点 = " + ExamRecord2.averageEnglish(rec));
    }
}