Basic calculator

Report a typo

Write a program that takes an operator ("+", "-", "*") and two integers as the command-line arguments and then outputs the result of the operator in the standard output. If the passed operator is not from the list, it must output the string "Unknown operator" without quotes.

Please, do not rename the provided class Problem.

Sample Input 1:

+ 10 20

Sample Output 1:

30

Sample Input 2:

% 1 15

Sample Output 2:

Unknown operator
Write a program in Java 17
class Problem {
public static void main(String[] args) {

}
}
___

Create a free account to access the full topic