java - Trouble verifying incorrect input in program -
i've written infix postfix calculator. works fine long infix equations valid, can't figure out how handle invalid equations. my program reads infix equations text file separated line breaks. prints results of converted postfix problems new text file. trying have if 1 equation invalid, instead of breaking program prints "invalid" on output page. i'm not sure do! my idea create case in list of switches mentioned "all other chars" somehow, since char isn't operator or operand, can't work @ all, , suspicious it's impossible. public class expressiontools extends consolecalculator { //for infix postfix static stack s; static string in; private string out = ""; /** * expression tools * @param input */ public expressiontools(string input) { in = input; // input = inputed string s = new stack<character>(); // stack = stack of chars } /** * determines string precedence * @throws postfixexception * @throws ioex...