From 015e83fbefe31b8b886f13e0183451e3ba45ac55 Mon Sep 17 00:00:00 2001
From: nooratef <36491699+nooratef@users.noreply.github.com>
Date: Mon, 2 Mar 2020 20:17:45 +0200
Subject: [PATCH 01/13] SphereArea
---
.idea/.name | 1 +
.idea/misc.xml | 6 +
.idea/modules.xml | 8 +
.idea/vcs.xml | 6 +
.idea/workspace.xml | 281 ++++++++++++++++++++++++++++++++
GitAssignmentObserver.iml | 12 ++
src/Main.java | 4 +-
src/ReallySimpleSubscriber.java | 8 -
src/SimpleSubscriber.java | 10 --
src/SphereArea.java | 14 ++
10 files changed, 330 insertions(+), 20 deletions(-)
create mode 100644 .idea/.name
create mode 100644 .idea/misc.xml
create mode 100644 .idea/modules.xml
create mode 100644 .idea/vcs.xml
create mode 100644 .idea/workspace.xml
create mode 100644 GitAssignmentObserver.iml
delete mode 100644 src/ReallySimpleSubscriber.java
delete mode 100644 src/SimpleSubscriber.java
create mode 100644 src/SphereArea.java
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..477e576
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+GitAssignmentObserver
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..cefb937
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..3dd0b66
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..dab0ff2
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,281 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1583172115957
+
+
+ 1583172115957
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GitAssignmentObserver.iml b/GitAssignmentObserver.iml
new file mode 100644
index 0000000..409f5aa
--- /dev/null
+++ b/GitAssignmentObserver.iml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Main.java b/src/Main.java
index 9b8c2b0..797c630 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -2,8 +2,8 @@
public class Main {
private static ISubscriber subscribers [] = {
- new SimpleSubscriber(),
- new ReallySimpleSubscriber(),
+ new SphereArea()
+
};
public static void main(String[] args) {
Topic mathTopic = new Topic();
diff --git a/src/ReallySimpleSubscriber.java b/src/ReallySimpleSubscriber.java
deleted file mode 100644
index fb1114a..0000000
--- a/src/ReallySimpleSubscriber.java
+++ /dev/null
@@ -1,8 +0,0 @@
-
-public class ReallySimpleSubscriber implements ISubscriber {
- @Override
- public void notifySubscriber(String input) {
- // TODO Auto-generated method stub
- System.out.println("Hello, I am really a simple subscriber and I am notified with " + input);
- }
-}
diff --git a/src/SimpleSubscriber.java b/src/SimpleSubscriber.java
deleted file mode 100644
index 5b0e4aa..0000000
--- a/src/SimpleSubscriber.java
+++ /dev/null
@@ -1,10 +0,0 @@
-
-public class SimpleSubscriber implements ISubscriber {
-
- @Override
- public void notifySubscriber(String input) {
- // TODO Auto-generated method stub
- System.out.println("Hello, I am a simple subscriber and I am notified with " + input);
- }
-
-}
diff --git a/src/SphereArea.java b/src/SphereArea.java
new file mode 100644
index 0000000..9308b42
--- /dev/null
+++ b/src/SphereArea.java
@@ -0,0 +1,14 @@
+public class SphereArea implements ISubscriber {
+ static float pi = 3.14159f;
+ @Override
+ public void notifySubscriber(String input) {
+
+ double Radius = Double.valueOf(input);
+ System.out.println( "Sphere Area = "+Calculate_Area(Radius));
+ }
+ double Calculate_Area(double radius){
+ return (4 * pi * radius * radius);
+ }
+
+ }
+}
From 09b61717fb440b93409c8d90ee0c64861fb0d8db Mon Sep 17 00:00:00 2001
From: Belal Hamdy
Date: Mon, 2 Mar 2020 21:06:31 +0200
Subject: [PATCH 02/13] Added Lucas Series 20170077
---
src/LucasSeries.java | 20 ++++++++++++++++++++
src/Main.java | 2 +-
2 files changed, 21 insertions(+), 1 deletion(-)
create mode 100644 src/LucasSeries.java
diff --git a/src/LucasSeries.java b/src/LucasSeries.java
new file mode 100644
index 0000000..b26a657
--- /dev/null
+++ b/src/LucasSeries.java
@@ -0,0 +1,20 @@
+public class LucasSeries implements ISubscriber {
+ @Override
+ public void notifySubscriber(String input) {
+ try {
+ int LucasIndex = Integer.parseInt(input);
+ System.out.println("Lucas Number is: " + Lucas(LucasIndex));
+ } catch (Exception e) {
+ System.out.println("Error: " + e.getMessage());
+ }
+ }
+
+ int Lucas(int idx) throws Exception {
+ if (idx <= 0) throw new Exception("Error: Lucas applied only for positive numbers.");
+ return Lucas(idx, 1, 2); // Lucas series 2 1 3 4 7 11 18 29
+ }
+
+ private int Lucas(int idx, int value, int previous) {
+ return (idx == 1 ? previous : Lucas(idx - 1, previous + value, value));
+ }
+}
diff --git a/src/Main.java b/src/Main.java
index 797c630..092220d 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -2,7 +2,7 @@
public class Main {
private static ISubscriber subscribers [] = {
- new SphereArea()
+ new SphereArea(), new LucasSeries()
};
public static void main(String[] args) {
From 94151f74f6224bc334c531aeb349e3351475cf54 Mon Sep 17 00:00:00 2001
From: Atef Magdy
Date: Mon, 2 Mar 2020 21:32:31 +0200
Subject: [PATCH 03/13] Added SphereCircumference class
---
.idea/codeStyles/codeStyleConfig.xml | 5 +
.idea/misc.xml | 2 +-
.idea/workspace.xml | 255 ++++-----------------------
GitAssignmentObserver.iml | 2 +-
src/Main.java | 2 +-
src/SphereArea.java | 1 -
src/SphereCircumference.java | 18 ++
7 files changed, 64 insertions(+), 221 deletions(-)
create mode 100644 .idea/codeStyles/codeStyleConfig.xml
create mode 100644 src/SphereCircumference.java
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index cefb937..ad36d52 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index dab0ff2..b38bcc1 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -1,61 +1,22 @@
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -67,48 +28,16 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
+
+
+
+
+
@@ -125,44 +54,25 @@
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
@@ -178,104 +88,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/GitAssignmentObserver.iml b/GitAssignmentObserver.iml
index 409f5aa..26db12c 100644
--- a/GitAssignmentObserver.iml
+++ b/GitAssignmentObserver.iml
@@ -7,6 +7,6 @@
-
+
\ No newline at end of file
diff --git a/src/Main.java b/src/Main.java
index 092220d..3349cb7 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -2,7 +2,7 @@
public class Main {
private static ISubscriber subscribers [] = {
- new SphereArea(), new LucasSeries()
+ new SphereArea(), new LucasSeries() , new SphereCircumference()
};
public static void main(String[] args) {
diff --git a/src/SphereArea.java b/src/SphereArea.java
index 9308b42..df48b27 100644
--- a/src/SphereArea.java
+++ b/src/SphereArea.java
@@ -11,4 +11,3 @@ public void notifySubscriber(String input) {
}
}
-}
diff --git a/src/SphereCircumference.java b/src/SphereCircumference.java
new file mode 100644
index 0000000..90de133
--- /dev/null
+++ b/src/SphereCircumference.java
@@ -0,0 +1,18 @@
+public class SphereCircumference implements ISubscriber{
+ @Override
+ public void notifySubscriber(String input)
+ {
+ try
+ {
+ double radius = Double.parseDouble(input);
+
+ double circumference = (2 * Math.PI * radius);
+
+ System.out.println("Sphere Circumference : " + circumference);
+ }
+ catch (Exception e)
+ {
+ System.out.println("Exception: " + e);
+ }
+ }
+}
\ No newline at end of file
From 1019e7cfcf3177a104acf4756bb8b5aa219d6e38 Mon Sep 17 00:00:00 2001
From: Ahmed Gamal <60451643+Ahmedgamal-0@users.noreply.github.com>
Date: Mon, 2 Mar 2020 21:43:23 +0200
Subject: [PATCH 04/13] Create spherevolume.java
---
src/spherevolume.java | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 src/spherevolume.java
diff --git a/src/spherevolume.java b/src/spherevolume.java
new file mode 100644
index 0000000..99f7855
--- /dev/null
+++ b/src/spherevolume.java
@@ -0,0 +1,21 @@
+package com.company;
+import java.lang.Math;
+
+public class Spherevolume implements ISubscriber{
+ @Override
+ public void notifySubscriber(String input)
+ {
+ try
+ {
+ double radius = Double.valueOf(input);
+
+ double Spherevolume = (4/3* Math.PI *Math.pow(radius,3));
+
+ System.out.println("Sphere volume : " + Spherevolume);
+ }
+ catch (Exception e)
+ {
+ System.out.println("Exception: " + e);
+ }
+ }
+}
From cbf4eec432c18c30bff526f45b125da69dbbf66c Mon Sep 17 00:00:00 2001
From: Atef Magdy
Date: Mon, 2 Mar 2020 21:57:24 +0200
Subject: [PATCH 05/13] Update SphereCircumference class
---
.idea/workspace.xml | 10 ++++------
src/SphereCircumference.java | 2 +-
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b38bcc1..3000664 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -2,12 +2,8 @@
-
-
-
-
-
+
@@ -93,7 +89,9 @@
diff --git a/src/SphereCircumference.java b/src/SphereCircumference.java
index 90de133..22389f2 100644
--- a/src/SphereCircumference.java
+++ b/src/SphereCircumference.java
@@ -8,7 +8,7 @@ public void notifySubscriber(String input)
double circumference = (2 * Math.PI * radius);
- System.out.println("Sphere Circumference : " + circumference);
+ System.out.println("Sphere Circumference = " + circumference);
}
catch (Exception e)
{
From 5009cc86cdac54b7b94ba785191cd24bb619ec0d Mon Sep 17 00:00:00 2001
From: "Mohamed A. Abd El-Nabey" <51803872+MOo-Ahmed@users.noreply.github.com>
Date: Mon, 2 Mar 2020 21:58:41 +0200
Subject: [PATCH 06/13] (20170364) added CircleArea
---
src/CircleArea.java | 14 ++++++++++++++
src/Main.java | 2 +-
src/SphereArea.java | 3 +--
3 files changed, 16 insertions(+), 3 deletions(-)
create mode 100644 src/CircleArea.java
diff --git a/src/CircleArea.java b/src/CircleArea.java
new file mode 100644
index 0000000..e0db006
--- /dev/null
+++ b/src/CircleArea.java
@@ -0,0 +1,14 @@
+
+public class CircleArea implements ISubscriber {
+ @Override
+ public void notifySubscriber(String input) {
+ try {
+ double r = Double.parseDouble(input);
+ if(r >= 0)
+ System.out.println("The circle with radius = " + r + " , has area = " + (r*r*3.14));
+ else System.out.println("Error , radius can't have negative value");
+ } catch (Exception e) {
+ System.out.println("Error: " + e.getMessage());
+ }
+ }
+}
diff --git a/src/Main.java b/src/Main.java
index 092220d..571193e 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -2,7 +2,7 @@
public class Main {
private static ISubscriber subscribers [] = {
- new SphereArea(), new LucasSeries()
+ new SphereArea(), new LucasSeries(), new CircleArea()
};
public static void main(String[] args) {
diff --git a/src/SphereArea.java b/src/SphereArea.java
index 9308b42..93bf7b7 100644
--- a/src/SphereArea.java
+++ b/src/SphereArea.java
@@ -9,6 +9,5 @@ public void notifySubscriber(String input) {
double Calculate_Area(double radius){
return (4 * pi * radius * radius);
}
-
- }
}
+
From cb94f726567a68f0e37c51717f1f4303aac95615 Mon Sep 17 00:00:00 2001
From: Ahmed Gamal <60451643+Ahmedgamal-0@users.noreply.github.com>
Date: Mon, 2 Mar 2020 22:05:35 +0200
Subject: [PATCH 07/13] Update Main.java
---
src/Main.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/Main.java b/src/Main.java
index 092220d..d800d0b 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -2,7 +2,8 @@
public class Main {
private static ISubscriber subscribers [] = {
- new SphereArea(), new LucasSeries()
+ new SphereArea(), new LucasSeries(),
+ new Spherevolume()
};
public static void main(String[] args) {
From 7cafe9e5a9cb78d13d76240b662585625c9e8a92 Mon Sep 17 00:00:00 2001
From: mostafaalaa00 <61460174+mostafaalaa00@users.noreply.github.com>
Date: Mon, 2 Mar 2020 22:20:17 +0200
Subject: [PATCH 08/13] Create summationSeries.java
---
src/summationSeries.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 src/summationSeries.java
diff --git a/src/summationSeries.java b/src/summationSeries.java
new file mode 100644
index 0000000..ad39313
--- /dev/null
+++ b/src/summationSeries.java
@@ -0,0 +1,13 @@
+public class summationSeries implements ISubscriber{
+
+ public void notifySubscriber(String input)
+ {
+ double sum = 0;
+ double counter = Double.valueOf(input);
+
+ for(double i=0 ; i<=counter ; i++){ //only for count number of series element
+ sum += i ;
+ }
+ System.out.println("series summation = " + sum );
+ }
+}
From a6048a70b2310991ab7fb0b9ff147d1a202d13d4 Mon Sep 17 00:00:00 2001
From: mostafaalaa00 <61460174+mostafaalaa00@users.noreply.github.com>
Date: Mon, 2 Mar 2020 22:33:05 +0200
Subject: [PATCH 09/13] Update Main.java
---
src/Main.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Main.java b/src/Main.java
index a5f0b3b..92bc10f 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -4,7 +4,7 @@ public class Main {
private static ISubscriber subscribers [] = {
new SphereArea(), new LucasSeries(),
- new Spherevolume()
+ new Spherevolume(), new summationSeries()
};
public static void main(String[] args) {
From 760a460d10bcb4fda2f6e441842227d91a27c233 Mon Sep 17 00:00:00 2001
From: hossam418 <61619534+hossam418@users.noreply.github.com>
Date: Mon, 2 Mar 2020 23:25:34 +0200
Subject: [PATCH 10/13] Add files via upload
---
src/MultiplicationSeries.java | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 src/MultiplicationSeries.java
diff --git a/src/MultiplicationSeries.java b/src/MultiplicationSeries.java
new file mode 100644
index 0000000..805d902
--- /dev/null
+++ b/src/MultiplicationSeries.java
@@ -0,0 +1,17 @@
+package com.company;
+
+
+public class MultiplicationSeries implements ISubscriber
+{
+ @Override
+ public void notifySubscriber(String input){
+ int n = Integer.parseInt(input);
+
+ long r=1,i=1;
+ while(i<=n){
+ r*=i;
+ i++;
+ }
+ System.out.println("the series Multiplication: "+r);
+ }
+}
From 8fc562a43c9d9289640cbedb12662df8bbbe2d43 Mon Sep 17 00:00:00 2001
From: Mariam Nasser
Date: Mon, 2 Mar 2020 23:27:11 +0200
Subject: [PATCH 11/13] 20170284
Fibonacci
---
src/Fibonacci.java | 19 +++++++++++++++++++
src/Main.java | 2 +-
2 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 src/Fibonacci.java
diff --git a/src/Fibonacci.java b/src/Fibonacci.java
new file mode 100644
index 0000000..2310c2e
--- /dev/null
+++ b/src/Fibonacci.java
@@ -0,0 +1,19 @@
+
+public class Fibonacci implements ISubscriber{
+
+ @Override
+ public void notifySubscriber(String input)
+ {
+ long n = Integer.parseInt(input);
+ long t1 = 0, t2 = 1;
+ for (int i = 1; i <= n; ++i)
+ {
+ System.out.print(t1 + " ");
+
+ long sum = t1 + t2;
+ t1 = t2;
+ t2 = sum;
+ }
+ }
+
+}
diff --git a/src/Main.java b/src/Main.java
index a5f0b3b..fd9e233 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -4,7 +4,7 @@ public class Main {
private static ISubscriber subscribers [] = {
new SphereArea(), new LucasSeries(),
- new Spherevolume()
+ new Spherevolume(), new Fibonacci()
};
public static void main(String[] args) {
From fab020738dc44fe02942c2b13e90e33289c89631 Mon Sep 17 00:00:00 2001
From: Suhail Hany <36114129+Suhail98@users.noreply.github.com>
Date: Tue, 3 Mar 2020 19:14:57 +0200
Subject: [PATCH 12/13] Add files via upload
20170121
---
src/CircleVolum.java | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 src/CircleVolum.java
diff --git a/src/CircleVolum.java b/src/CircleVolum.java
new file mode 100644
index 0000000..6022ca0
--- /dev/null
+++ b/src/CircleVolum.java
@@ -0,0 +1,17 @@
+package com.company;
+
+public class CircleVolum implements ISubscriber {
+ @Override
+ public void notifySubscriber(String input) {
+ try {
+ double radius = Double.parseDouble(input);
+ System.out.println(calculateVolum(radius));
+ } catch (Exception e) {
+ System.out.println("Error: " + e.getMessage());
+ }
+ }
+ private double calculateVolum(double radius)
+ {
+ return radius * radius * radius * (4.0/3) * 3.14;
+ }
+}
From 320a8f557ff63da4044a8261193a4933c2bf4a85 Mon Sep 17 00:00:00 2001
From: Suhail Hany <36114129+Suhail98@users.noreply.github.com>
Date: Tue, 3 Mar 2020 19:15:51 +0200
Subject: [PATCH 13/13] Update Main.java
---
src/Main.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Main.java b/src/Main.java
index 829bd8c..864a60d 100644
--- a/src/Main.java
+++ b/src/Main.java
@@ -6,7 +6,7 @@ public class Main {
new SphereArea(), new LucasSeries(),
new CircleArea() , new SphereCircumference () ,
new Spherevolume(), new summationSeries()
- , new Fibonacci() , new MultiplicationSeries ()
+ , new Fibonacci() , new MultiplicationSeries (), new CircleVolum()
};
public static void main(String[] args) {