You are viewing a single comment's thread. Return to all comments →
Java class Calculator implements AdvancedArithmetic {`
int totalSum; public int divisorSum(int n) { for(int d = 1; d <= n; d++){ if(n % d == 0){ totalSum +=d; } } return totalSum; }
} `
Seems like cookies are disabled on this browser, please enable them to open this website
Day 19: Interfaces
You are viewing a single comment's thread. Return to all comments →
Java class Calculator implements AdvancedArithmetic {`
int totalSum; public int divisorSum(int n) { for(int d = 1; d <= n; d++){ if(n % d == 0){ totalSum +=d; } } return totalSum; }
} `