Lecture Notes on 12 Jun 2015 import java.util.*; public class Test { // computes the sum of the proper divisors of n public static int sumDivisors (int n) { int sum = 0; int divisor = 1; int limit = n / 2; while (divisor <= limit) { if (n % divisor == 0) { sum = sum + divisor; } divisor = divisor + 1; } return sum; } public static void main (String[] args) { // create a Scanner object Scanner sc = new Scanner (System.in); // prompt the user to enter a number System.out.print ("Enter a number: "); // read the user's input int n = sc.nextInt(); // print the sum of the proper divisors System.out.println (sumDivisors (n)); } }