diff --git a/src/DegreePlanAnalytics.jl b/src/DegreePlanAnalytics.jl index 430dc8e..00b1dac 100644 --- a/src/DegreePlanAnalytics.jl +++ b/src/DegreePlanAnalytics.jl @@ -138,4 +138,15 @@ function requisite_distance(plan::DegreePlan) distance = distance + requisite_distance(plan, c) end return plan.metrics["requisite distance"] = distance +end + +#TODO: write docstring, write tests +function credit_balance(plan::DegreePlan) + bal = 0 + for i in 1:length(plan.terms)-1 + for j in i+1:length(plan.terms) + bal += abs(plan.terms[i].credit_hours - plan.terms[j].credit_hours) + end + end + return bal end \ No newline at end of file