-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.java
More file actions
29 lines (29 loc) · 1009 Bytes
/
code.java
File metadata and controls
29 lines (29 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import java.util.*;
class Calculator{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
System.out.println("Input full operation name in english which you want to perform ");
var operat=sc.nextLine();
var operation=operat.toUpperCase();
System.out.println("Input first Operand");
var first_Operand=sc.nextInt();
System.out.println("Input second Operand");
var second_Operand=sc.nextInt();
switch(operation){
case "ADDITION":
System.out.println(first_Operand+second_Operand);
break;
case "SUBSTRACTION":
System.out.println(first_Operand-second_Operand);
break;
case "MULTIPLICATION":
System.out.println(first_Operand*second_Operand);
break;
case "DIVISION":
System.out.println(first_Operand+second_Operand);
break;
default:
System.out.println("Invalid operation");
}
}
}