write a program to create calculator in java must contain mfollowing method input vales,add,sub,divide,multiply and having two clases and method overloading code example
Example: how to make a calculator using switch case in java
Scanner sc= new Scanner(System.in);
int firstNum= sc.nextInt();
int secondNum= sc.nextInt();
System.out.println("Enter an operator (+, -, *, /):");
char operator= sc.next().chartAt(0);
double result=0;
switch(operator){
case "+":
result+= firstNum+ secondNum;
break;
case "-":
result+= firstNum-secondNum;
break;
case "*":
result+= firstNum*secondNum;
break;
case "/":
result+= firstNum/secondNum;
break;
}