@@ -0,0 +1,1054 @@
+// From https://www.hackerrank.com/challenges/30-interfaces%0A%0A// Write the Calculator class, which implements the AdvancedArithmetic%0A// interface. The implementation for the divisorSum method must be public%0A// and take an integer parameter, n, and return the sum of all its divisors.%0A%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Ainterface AdvancedArithmetic%7B%0A   int divisorSum(int n);%0A%7D%0A%0Aclass Calculator implements AdvancedArithmetic%7B%0A%0A    public int divisorSum(int n)%7B%0A        int result = 0;%0A%0A        for(int i = n; i %3E 0; i--)%7B%0A            if(n %25 i == 0)%7B%0A                result += i;%0A            %7D%0A        %7D%0A%0A        return result;%0A    %7D%0A%7D%0A%0Aclass Solution %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner scan = new Scanner(System.in);%0A        int n = scan.nextInt();%0A        scan.close();%0A%0A      %09AdvancedArithmetic myCalculator = new Calculator();%0A        int sum = myCalculator.divisorSum(n);%0A        System.out.println(%22I implemented: %22 + myCalculator.getClass().getInterfaces()%5B0%5D.getName() );%0A        System.out.println(sum);%0A    %7D%0A%7D%0A

Add solution to day 19