Java Problems/PWSkills Assignments/Conditionals/SimpleCalculator.java
<filename>Java Problems/PWSkills Assignments/Conditionals/SimpleCalculator.java<gh_stars>0import java.util.Scanner;

public class SimpleCalculator {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            System.out.println("Enter 2 numbers");
            int x = sc.nextInt();
            int y = sc.nextInt();
            System.out.print("Enter an operator (+,-,*,/): ");
            char op = sc.next().charAt(0);
            switch (op) {
                case '+':
                    System.out.println(x+y);
                    break;
                case '-':
                    System.out.println(x-y);
                    break;
                case '*':
                    System.out.println(x*y);
                    break;
                case '/':
                    System.out.println(x/y);
                    break;
                default:
                    System.out.println("Enter correct operator");
                    break;
            }
        }
    }
}
