-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathMain.java
41 lines (33 loc) · 955 Bytes
/
Main.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
public class Main {
public static Calculator calc;
public static void main(String[] args) {
Main main = new Main();
}
public Main(){
init();
}
public void init(){
calc = new Calculator(
new Amplifier(),
new Summator(),
new Contractor(),
new Divider()
);
System.out.println("5 * 10 = " + calc.amp(
new FInteger(5),
new FInteger(10)
).getValue());
System.out.println("45 + 5 = " + calc.sum(
new FInteger(45),
new FInteger(5)
).getValue());
System.out.println("64 - 14 = " + calc.cont(
new FInteger(64),
new FInteger(14)
).getValue());
System.out.println("100 / 2 = " + calc.div(
new FInteger(100),
new FInteger(2)
).getValue());
}
}