public void performOperation(int i, char c, PrintWriter pen)
	    throws Exception {
	ArrayBasedStackIterator<Double> it = new ArrayBasedStackIterator<Double>(
		RPNStack);
	// These two if statements make sure there are at least two numbers on
	// the stack--the minimum number required to perform any of the
	// operations we defined
	if (it.hasNext()) {
	    it.next();
	    if (it.hasNext()) {
		if (c == '+') {
		    add();
		} else if (c == '*') {
		    multiply();
		} else if (c == '/') {
		    divide();
		} else if (c == 'n') {
		    min();
		} else if (c == 'x') {
		    max();
		} else if (c == 'a') {
		    avg();
		} // else if
		return;
	    } // if
	} // if
	pen.println("Invalid entry! Insufficient numbers on the stack.");
    } // performOperation(int, char, PrintWriter)