This program evaluates an arithmetic expression.
From the previous example, the expression will now be: { "(", "3", "+", "4", "+", "(", "8", "+", "20", ")", ")" }.
Input must follow the rules of simple arithmetic. That is, an operation must be enclosed in a set of parenthesis (). For example, (3 +(4*5)) is a valid input, whereas (3+ 4*5) is not.
Chaining is implemented in this program. That is, multiple numeric values can be contained within the same set of parenthesis if the operation between these values are consistent. For example, (3+4+5) and (3*4*5) are both valid inputs, whereas (3*4+5) is not.
Negative values are accepted in the input expression, however, please make sure that the negative sign is contained in a set of parenthesis. For example, ((-5)-2) is a valid input, whereas (-5 -2) is not.
White spaces in the input expression will be ignored during the tokenize process. That is, the expression ( 3 +4 + 5 ) will be treated the same way as (3+4+5).
If the input doesn't follow simple arithmetic, the program will quit immediately.
If the input expression attempts a division by 0, the program will throw an exception.