import java.util.Scanner;
public class CalculateTest {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    char firstChar  = 'y';
    String answer = "";
    // loop while you keep getting answers starting with y
    do {
      // statements here
      System.out.print("Enter a positive integer: ");
      int n = in.nextInt();
      while ( n <= 0 ) {
        System.out.println("That's not positive!");
        System.out.print("Enter a positive integer: ");
        n = in.nextInt();
      }
      System.out.println("Factorial = " +
                         Calculate.fact(n));
      System.out.print("Divisors = ");
      Calculate.printAllDivisors(n);
      System.out.println("Prime = " +
                         Calculate.isPrime(n));
      System.out.println("Sum of Proper Divisors = " +
                         Calculate.sumOfProperDivisors(n));
      System.out.println("Perfect = " +
                         Calculate.isPerfect(n));
      
      // ask user if wants to continue
      System.out.print("Would you like to continue? (y or n) ");
      answer = in.next();
      firstChar = answer.charAt(0);
    } while (firstChar == 'y');
    
  }
}