package j2.lesson02_2;
public class ExamRecord5Action {
public static void main(String[] args) {
ExamRecord5[] rec = new ExamRecord5[4];
rec[0] = new ExamRecord5("Taro", 1001, 50, 90, 100, 40, 90);
rec[1] = new ExamRecord5("Hanako", 1002, 70, 30, 80, 100, 70);
rec[2] = new ExamRecord5("Kenji", 1003, 60, 50, 70, 60, 80);
rec[3] = new ExamRecord5("Aya", 1004, 40, 100, 90, 50, 55);
ExamRecord5.sortByMath(rec);
System.out.println("===数学の点数順に並べると===");
for(int i=0; i<rec.length; i++){
System.out.println(rec[i].name + ", id=" + rec[i].id +
", math=" + rec[i].ma);
}
ExamRecord5.sortByTotal5(rec);
System.out.println("===5科目の合計点の順に並べると===");
for(int i=0; i<rec.length; i++){
System.out.println(rec[i].name + ", id=" + rec[i].id +
", total5=" + rec[i].getTotal5());
}
}
}
|