Write SafeCalculator. Each input line is an expression a op b with integers and one of + - * / %. A method int apply(int a, String op, int b) computes it and throws IllegalArgumentException("unknown operator '^'") for other operators (division by zero throws ArithmeticException by itself).
main reads lines until the end of input, skips empty lines, and catches each problem separately:
12 / 4 = 3
7 / 0 -> cannot divide by zero
x + 1 -> not a whole number (For input string: "x")
2 ^ 8 -> unknown operator '^'
A line that does not have three parts throws IllegalArgumentException("expected: number operator number"). Use a finally block that prints [3 lines processed] after every third line. End with Done: 2 ok, 3 errors.