This is a code to verify if a given equation is correct. Like if I enter "3 + 4 - (6 * 5) / 2" it is correct, but if I do "a + 5" or "a ++ 3)" or "((1 + 2)" they will all give errors, for it must be a solvable equation with no unknown variables.

However, I am pretty sure all these errors have been fixed, but I do not know how to check for incorrect parenthesis direction. Like if the user enters ")1 + 2( - 2" or something to that extent. Parenthesis can be nested so this makes it a bit harder, like this would be accepted: ((1 + 5) / 3)

Even simplier, use an integer value (that starts at 0). Traverse the expression. For every ( add 1 to the variable, and for every ) subtract 1.
If the variable ever go below 0 or if it isn't 0 at the end, there is something wrong.