Ad

Now you are going to make a simple calculator.
The expression will be like this: n {symbol} m = {return value};

Example:
int result = calculate(4, 5, +); // 4 + 5 = 9;

Symbols are +, -, *.

public class calculator {
  public static int calculate(int n, int m, char symbol) {
    // do your best :)
    int result = 0;
    switch(symbol) {
        case '+':
      result = n + m;
      break;
        case '-':
      result = n - m;
      break;
        case '*':
      result = n * m;
      break;
    }
  return result;
  }
}