Browse Source

Added calculateTotalCredits Method in Student class

remotes/origin/fdai7887
fdai7887 11 months ago
parent
commit
2e5a2eb3ac
  1. 8
      src/main/java/org/example/Student.java

8
src/main/java/org/example/Student.java

@ -120,4 +120,12 @@ public class Student {
}
}
public int calculateTotalCredits() {
int totalCredits = 0;
for (Course course : courseGrades.keySet()) {
totalCredits += course.getCourseCredits();
}
return totalCredits;
}
}
Loading…
Cancel
Save