This commit is contained in:
louiscklaw
2025-01-31 19:15:17 +08:00
parent 09adae8c8e
commit 6c60a73f30
1546 changed files with 286918 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
public class Ex2c {
public static void main(String[] args) {
Student[] students = new Student[3];
students[0] = new Student("Cheung Siu Ming", 310567, 87.1);
students[1] = new Student("CNg Wai Man", 451267, 77.5);
students[2] = new Student("Wong Sui Kai", 789014, 83.4);
double totalScore = 0.0;
for (Student student : students) {
student.printDetails();
totalScore += student.getScore();
}
System.out.println("Average Score = " + totalScore/students.length);
}
}