-
Notifications
You must be signed in to change notification settings - Fork 0
/
calculator_Machine.java
46 lines (46 loc) · 1.41 KB
/
calculator_Machine.java
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
package CalculatorMachine;
import java.util.Scanner;
public class calculator_Machine {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double number1,number2,result,select;
System.out.println("Islem Seciniz");
System.out.println("1-Toplama\n" + "2-Cikarma\n"+ "3-Carpma\n" + "4-Bolme\n");
select=input.nextInt();
if(select==1) {
System.out.println("Number One Please: ");
number1=input.nextDouble();
System.out.println("Number Two Please: ");
number2=input.nextDouble();
result=number1+number2;
System.out.println("Sum Result: "+result);
}
else if(select==2) {
System.out.println("Number One Please: ");
number1=input.nextDouble();
System.out.println("Number Two Please: ");
number2=input.nextDouble();
result=number1-number2;
System.out.println("Ex Result: "+result);
}
else if(select==3) {
System.out.println("Number One Please: ");
number1=input.nextDouble();
System.out.println("Number Two Please: ");
number2=input.nextDouble();
result=number1*number2;
System.out.println("Çarpma Result: "+result);
}
else if(select==4) {
System.out.println("Number One Please: ");
number1=input.nextDouble();
System.out.println("Number Two Please: ");
number2=input.nextDouble();
result=(double)number1/(double)number2;
System.out.println("Ex Result: "+result);
}
else {
System.out.println("Error Select");
}
}
}