-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalculator.kb
45 lines (37 loc) · 978 Bytes
/
Calculator.kb
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
Int main(){
Scanner num = Scanner(in):
int num1:
int num2:
print('Enter First Number='):
println():
num1 = num.nextInt():
print('Enter Second Number='):
num2 = num.nextInt():
println():
int calc:
int result:
print('For addition press 1, For substraction press 2, For multiplication press 3, For divison press 4.'):
println():
calc = num.nextInt():
switch (calc) {
case 1
result=num1+num2:
print('You choose addition, result = ' + result):
break:
case 2
result=num1-num2:
print('You choose substraction, result = ' + result):
break:
case 3
result=num1*num2:
print('You choose multiplication, result = ' + result):
break:
case 4
result=num1/num2:
print('You choose divison, result = ' + result):
break:
default
println('Wrong Choise!Please enter 1, 2, 3, 4'):
break:
}
}