import java.util.Scanner;

public class CalculatorExample {
    public static void main(String[] args) {
        Scanner myScanner = new Scanner(System.in);
        
        System.out.println("Please enter your simple math expression");
        
        //get the expression from the user
        int number1 = myScanner.nextInt();
        char operator = myScanner.next().charAt(0);
        int number2 = myScanner.nextInt();
        
        int result;
        
        //perform the calculation
        switch(operator) {
            case '+':
                result = number1 + number2;
                break;
            case '-':
                result = number1 - number2;
                break;
			case 'x':
            case '*':
                result = number1 * number2;
                break;
            case '/':
                result = number1 / number2;
                break;
            case '%':
                result = number1 % number2;
                break;
            default:
                System.out.println("Invalid operator");
                
                //exit the program
                return;
        }
        
        //print out the result
        System.out.println(number1 + " " + operator + " " + number2 + " = " + result);
    }
}