class ExceptionExample {
  private int [] myArray;
  
  public ExceptionExample() {
    myArray = new int[10];
    // all initialized to zero
  }  // end default constructor
  
  public void addValue(int n, int value) {
    // add value to element n by calling addOne n times
    for (int i = 1; i <= value; i++) {
      addOne(n);
    } // end for
  } // end addValue
  
  public void addOne(int n) {
    // add 1 to the element n
      myArray[n] += 1;
  } // end addOne
} // end ExceptionExample
