public double calculateResult() throws IllegalArgumentException {
		if (firstOperand != Double.NaN && secondOperand != Double.NaN) {			
			if (operator == '+') {
				return this.firstOperand + this.secondOperand;
			} else if (operator == '-') {
				return this.firstOperand - this.secondOperand;
			} else if (operator == '*') {
					return this.firstOperand*this.secondOperand;
			} else if (operator == '/') {
				if (this.secondOperand != 0) {
					return this.firstOperand/this.secondOperand;
				} else {
					throw new IllegalArgumentException("You can't divide by zero");					
				}
			} else if (operator == '%') {
				return this.firstOperand%this.secondOperand;
			} else if (operator == '^') {
				return Math.pow(this.firstOperand, this.secondOperand);
			} else {
				throw new IllegalArgumentException(operator + " is not a legal operator");
			}
		} else {
			return Double.NaN;
		}
	}