-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (27 loc) · 705 Bytes
/
Main.java
File metadata and controls
30 lines (27 loc) · 705 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
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
while(true) {
ThreadSubscriber subscribers [] = {
new SphereArea() ,
new CircleArea(),
new CircleCircumference(),
new SummationSeries(),
new MultiplicationSeries(),
new CircleVolum(),
new LucasSeries(),
new Fibonacci(),
new twoPowerN()
};
Topic mathTopic = new Topic();
for (ThreadSubscriber sub : subscribers) {
mathTopic.addSubscriber(sub);
sub.setTopic(mathTopic);
}
Scanner sc = new Scanner(System.in);
double input = sc.nextDouble();
mathTopic.setInput(input);
mathTopic.dispatchEvent();
}
}
}