-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArithmaticSwitch.java
More file actions
46 lines (36 loc) · 830 Bytes
/
Copy pathArithmaticSwitch.java
File metadata and controls
46 lines (36 loc) · 830 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
public class ArithmaticSwitch {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(
"Arithamatic Operation :\n 1.Addition \n" + " 2.Substraction \n 3.Multiplication \n 4.Division");
int choice = 2;
switch (choice) {
case 1:
Addition Add = new Addition();
Add.initValues(10, 30);
Add.calculateAdd();
Add.display();
break;
case 2:
Substraction Sub = new Substraction();
Sub.initValues(90, 60);
Sub.calculateSub();
Sub.display();
break;
case 3:
Multiplication Mul = new Multiplication();
Mul.initValues(10, 20);
Mul.calculationMul();
Mul.display();
break;
case 4:
if (5 != 0) {
Division Div = new Division();
Div.initValues(90, 5);
Div.calculationDiv();
Div.display();
}
break;
}
}
}