diff --git a/src/main/java/org/example/Student.java b/src/main/java/org/example/Student.java index a0b7074..4917f2e 100644 --- a/src/main/java/org/example/Student.java +++ b/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; + } + }