A console application "Calculator". The application must read the arithmetic operations entered by the user from the console and output the result of their execution to the console. The user inputs the whole mathematical expression in ONE line.
Requirements
- The calculator can perform addition, subtraction, multiplication and division operations with THREE numbers: a + b - c, a - b + c, a * b - c, a / b * c.
- Two numbers can also be used as input.
- The calculator must accept input numbers from 1 to 10 inclusive, no more. At the output, the numbers are not limited in size.
- The calculator can only work with integers.
- When the user enters invalid numbers, the application throws an exception and exits.
- When the user enters a string that does not match one of the above arithmetic operations, the application throws an exception and exits.