Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6083d9d
init commit for fork
ahmeddrawy Feb 28, 2020
ef91029
adding circle area class andd its object in main
ahmeddrawy Feb 28, 2020
e343a77
removed example classess simpleSubscriber and ReallySimpleSubscriber.…
fares09 Feb 28, 2020
c6a5993
Adding CircleCircumference()
ahmed-focus Feb 28, 2020
9f83e94
adding CircleCircumference()
ahmed-focus Feb 28, 2020
4f865c5
m
ahmed-focus Feb 28, 2020
f08a468
Add Lucas Series Class that implement Function
NaglaEssam12 Feb 29, 2020
1ec0222
Add object of LucasSeriesSub to List of Subscriber
NaglaEssam12 Feb 29, 2020
efa6edb
added a description to println in notifySubscriber function in Sphere…
fares09 Mar 1, 2020
367475b
Create MultiplicationSeries.java
ayaamr11 Mar 1, 2020
a54e848
modifications
ayaamr11 Mar 1, 2020
a4eb213
Update MultiplicationSeries.java
ayaamr11 Mar 1, 2020
9cc4442
Update MultiplicationSeries.java
ayaamr11 Mar 1, 2020
5dff410
20170027/Added CircleVolume Class
ahmedmagdy99 Mar 2, 2020
a5119b1
20140046/ CircleCircumference
ahmed-focus Mar 2, 2020
8b8d830
SphereVolume class added with overriding NotifySubscriber method
mina5alaf Mar 2, 2020
cddfc10
Class SphereVolume added with overriding the method "NotifySubscriber"
mina5alaf Mar 2, 2020
b744155
Added class SphereVolume with overriding Notifysubscriber
mina5alaf Mar 2, 2020
d74ac4a
Added class SphereVolume
mina5alaf Mar 2, 2020
41d8143
added power function
youssefadel92 Mar 2, 2020
d3438ba
20170313 / Add Lucas Series Class that Implement
NaglaEssam12 Mar 2, 2020
4b8fd04
20170313/ Add object of LucasSeriesSub Class to
NaglaEssam12 Mar 2, 2020
101ca2b
20170313 / delete ReallySimpleSubscriber Class
NaglaEssam12 Mar 2, 2020
f4c61a2
20170313 / delete Simple Subscriber Class
NaglaEssam12 Mar 2, 2020
f94373c
Merge pull request #1 from ahmeddrawy/fares_20170191
ahmeddrawy Mar 3, 2020
9773f48
Merge branch 'master' into fawzy
ahmeddrawy Mar 3, 2020
5959efc
Merge pull request #2 from ahmeddrawy/fawzy
ahmeddrawy Mar 3, 2020
784f69f
Merge branch 'master' into Naglaa---20170313
ahmeddrawy Mar 3, 2020
bf9cdbc
Merge pull request #7 from ahmeddrawy/Naglaa---20170313
ahmeddrawy Mar 3, 2020
40e3933
Merge branch 'master' into minakhalaf-20170308
ahmeddrawy Mar 3, 2020
fbccacc
Merge pull request #5 from mina5alaf/minakhalaf-20170308
ahmeddrawy Mar 3, 2020
11b59c2
Merge branch 'master' into youssef(20170345)
ahmeddrawy Mar 3, 2020
48416bf
Merge pull request #6 from ahmeddrawy/youssef(20170345)
ahmeddrawy Mar 3, 2020
3cf6b17
Merge branch 'master' into Hanafy
ahmeddrawy Mar 3, 2020
ad8b431
Merge pull request #8 from ahmeddrawy/Hanafy
ahmeddrawy Mar 3, 2020
d29494c
Merge branch 'master' into aya-
ahmeddrawy Mar 3, 2020
a0c48dc
Merge pull request #9 from ahmeddrawy/aya-
ahmeddrawy Mar 3, 2020
b9116dc
20170027/Added instance for CircleVolume class to the main
ahmedmagdy99 Mar 3, 2020
3456a4c
Merge branch 'master' into 20170027/CircleVolume
ahmeddrawy Mar 3, 2020
ad266a7
Merge pull request #10 from ahmeddrawy/20170027/CircleVolume
ahmeddrawy Mar 3, 2020
befef6c
Merge branch 'master' into 20140046/CircleCircumference
ahmeddrawy Mar 3, 2020
2ea812c
Merge pull request #4 from ahmeddrawy/20140046/CircleCircumference
ahmeddrawy Mar 3, 2020
aaf91a4
20170027/Updated CircleVolume class
ahmedmagdy99 Mar 3, 2020
ca4f35b
Merge pull request #11 from ahmeddrawy/20170027/CircleVolume
ahmeddrawy Mar 3, 2020
bc9a65d
Add files via upload
oali88 Mar 4, 2020
abdf2df
Update Main.java
oali88 Mar 4, 2020
f81dd2d
Update summtionSeries.java
oali88 Mar 5, 2020
191b767
Update summtionSeries.java
oali88 Mar 5, 2020
c8963b8
Update summtionSeries.java
oali88 Mar 5, 2020
501dace
Merge pull request #13 from ahmeddrawy/sum/20160152
oali88 Mar 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions init.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
init repo

10 changes: 10 additions & 0 deletions src/CircleAreaObserver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
public class CircleAreaObserver implements ISubscriber {
@Override
public void notifySubscriber(String input) {
System.out.println("Circle of radius = " + " has Area = " + areaOfCircle(Integer.parseInt(input)));
}
private double areaOfCircle(int r){
return Math.PI *r *2;

}
}
8 changes: 8 additions & 0 deletions src/CircleCircumference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public class CircleCircumference implements ISubscriber {

public void notifySubscriber(String input) {
double radius=Double.parseDouble(input);
double circumference= Math.PI * 2*radius;
System.out.println( "The circumference of this circle is: "+circumference) ;
}
}
12 changes: 12 additions & 0 deletions src/CircleVolume.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import java.util.Scanner;
import java.lang.Math;

public class CircleVolume implements ISubscriber {

public void notifySubscriber(String input) {
final double PI = 3.1415926535;
double radius = Double.parseDouble(input);
double result = ((4.0/3.0)*PI*Math.pow(radius,3));
System.out.println( "Circle Volume = "+result) ;
}
}
39 changes: 39 additions & 0 deletions src/LucasSeriesSub.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import java.util.ArrayList;

public class LucasSeriesSub implements ISubscriber {
@Override
public void notifySubscriber(String input) {
int numOfTerms = Integer.parseInt(input);
ArrayList<Integer>lucesResult = new ArrayList<Integer>();
int temp1 = 2 , temp2 = 1;
int j = 0 , temp = 0;
if(numOfTerms == 1)
{
lucesResult.add(temp1);
}
else if (numOfTerms == 2)
{
lucesResult.add(temp1);
lucesResult.add(temp2);
}
else if (numOfTerms > 2)
{
lucesResult.add(temp1);
lucesResult.add(temp2);
for(int i = 2 ; i < numOfTerms ; i++)
{
temp1 = lucesResult.get(j);
temp2 = lucesResult.get(++j);
temp = temp1 + temp2;
lucesResult.add(temp);
}
}
else
{
System.out.println("Not invalid Input");
System.exit(0);
}
System.out.println("The Series is : " + lucesResult);
}

}
11 changes: 9 additions & 2 deletions src/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

public class Main {
private static ISubscriber subscribers [] = {
new SimpleSubscriber(),
new ReallySimpleSubscriber(),
new CircleCircumference(),
new CircleVolume(),
new MultiplicationSeries(),
new CircleAreaObserver(),
new Power(),
new SphereVolume(),
new SphereAreaSub(),
new summtionSeries(),
new LucasSeriesSub()
};
public static void main(String[] args) {
Topic mathTopic = new Topic();
Expand Down
17 changes: 17 additions & 0 deletions src/MultiplicationSeries.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
public class MultiplicationSeries implements ISubscriber {
public void notifySubscriber(String input){
// TODO Auto-generated method stub

int n =Integer.parseInt(input);
int result = n;


while(n>1) {
n-=1;
result =result *n;


}
System.out.println("the multiplication series of " + input +" is " + result );
}
}
8 changes: 8 additions & 0 deletions src/Power.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import java.math.*;
public class Power implements ISubscriber {
@Override
public void notifySubscriber(String input) {
// TODO Auto-generated method stub
System.out.println("2 Power "+input+": "+Math.pow(2, Double.parseDouble(input)));
}
}
8 changes: 0 additions & 8 deletions src/ReallySimpleSubscriber.java

This file was deleted.

10 changes: 0 additions & 10 deletions src/SimpleSubscriber.java

This file was deleted.

13 changes: 13 additions & 0 deletions src/SphereAreaSub.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

public class SphereAreaSub implements ISubscriber{


public void notifySubscriber(String input) { // input will be a single integer for all functions.
int r = Integer.parseInt(input);// radius
double area;
area = 4 * 3.14 * (r*r); // 4Pi*r^2.
System.out.println("Sphere Area with r = "+ r +": " + area);
}


}
11 changes: 11 additions & 0 deletions src/SphereVolume.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

public class SphereVolume implements ISubscriber{
public void notifySubscriber(String input) {
Float Rad;
double Res;
Rad = Float.parseFloat(input);
Res=(4/3)*(3.14)*(Rad*Rad*Rad);
System.out.println("Sphere Volume =" + Res);
}

}
12 changes: 12 additions & 0 deletions src/summtionSeries.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class summtionSeries implements ISubscriber {
public void notifySubscriber(String input){
int x = Integer.parseInt(input);
int sum = 0;
for (int i = 0; i <= x; i++) {
sum += i;
}
System.out.println(sum);
//20160152 ali osama ali

}
}