import java.util.Scanner;

public class FundRaising  {
  /** 11/21/2018
    * This class answers question II on Sample Exam 2.
    * 
    */
  public static void main(String[] args) {
    // without using arrays
    // need individual variables
    /******
    int check;
    int totalLess100=0, countMore100=0, totalMore100=0; 
    System.out.println("How many checks will you enter? ");
    Scanner sc = new Scanner(System.in);
    int numChecks = sc.nextInt();
    System.out.println("Enter the values of all of your checks.");
    for (int i=0; i<numChecks; i++) {
      check = sc.nextInt();
      if (check >= 100) {
        totalMore100+=check;
        countMore100++;
      }
      else {
        totalLess100+=check;
      }
     }
      System.out.println("The total value of all checks less than $100 is "
                           + totalLess100);
      System.out.println("You collected " + countMore100 + " checks of $100 "
                           + " or more for a total of " + totalMore100);   
    ***********/
    // with using arrays
    int totalLess100=0, countMore100=0, totalMore100=0; 
    System.out.println("How many checks will you enter? ");
    Scanner sc = new Scanner(System.in);
    int numChecks = sc.nextInt();
    int[] checks = new int[numChecks];
    System.out.println("Enter the values of all of your checks.");
    for (int i=0; i<numChecks; i++) {
      checks[i] = sc.nextInt();
      if (checks[i] >= 100) {
        totalMore100+=checks[i];
        countMore100++;
      }
      else {
        totalLess100+=checks[i];
      }
    }
      System.out.println("The total value of all checks less than $100 is "
                           + totalLess100);
      System.out.println("You collected " + countMore100 + " checks of $100 "
                           + " or more for a total of " + totalMore100);   
  
  } // end method
}



