Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
de06f36
Nothing changed
AshrafSamir Feb 26, 2020
c0ed377
This my funtion 2PowerN
AshrafSamir Feb 26, 2020
63b3a51
Modified gitignore for IntelliJ users
ahmadkkhaled Feb 28, 2020
4f0fc11
Modified .gitignore for IntelliJ users
ahmadkkhaled Feb 28, 2020
d9094d0
Added class Circle
ahmadkkhaled Feb 28, 2020
6ac26bc
20170377 changed radius type from Double to Integer
ahmadkkhaled Feb 28, 2020
706693c
Merge branch 'master' of https://github.com/AshrafSamir/git_assignmen…
AshrafSamir Feb 28, 2020
66c3b7b
20170377 merged branch master with branch circle-area
ahmadkkhaled Feb 28, 2020
5da5013
20170377 removed SimpleSubscriber(s) from Main
ahmadkkhaled Feb 28, 2020
c495192
git commit -m "20170235 added new files
mohamed7632 Feb 28, 2020
ff33fae
Merged branch master with branch spherevolume
ahmadkkhaled Feb 28, 2020
1423856
20170377 Modified printed message in class Spherevolume
ahmadkkhaled Feb 28, 2020
02baf0a
Add files via upload
mai41 Feb 28, 2020
8c6f11d
Delete .classpath
mai41 Feb 28, 2020
eb36eaf
Delete .gitignore
mai41 Feb 28, 2020
669c466
Delete Team26.java
mai41 Feb 28, 2020
a0c7946
Add files via upload
mai41 Feb 28, 2020
803ae3f
Add files via upload
mai41 Feb 28, 2020
fcea9fc
Update Main.java
mai41 Feb 28, 2020
3e4e11d
20170377 Moved source code to directory src/
ahmadkkhaled Feb 29, 2020
bbe7d04
20170377 Added .gitignore to branch CircleCircumference
ahmadkkhaled Feb 29, 2020
29eee1d
Update Main.java
MayadaMohamed11 Feb 29, 2020
b978cac
Add files via upload
MayadaMohamed11 Feb 29, 2020
43985e0
Update CircleVolum.java
MayadaMohamed11 Feb 29, 2020
44f5929
Lucas series added
mohamedmostafaouda Feb 29, 2020
c70d844
Updated "Main" Class to operate the Lucas class
mohamedmostafaouda Feb 29, 2020
1ac81b2
20170075/ adedd SphereCircumference
Bassant31 Feb 29, 2020
1494875
Added SphereArea class, Name : Abdelrahman Ibrahim, ID: 20170139
abdelrahmanIEl-Batal Feb 29, 2020
fde60fb
Added SphereArea, Name:Abdelrahman Ibrahim, ID:20170139
abdelrahmanIEl-Batal Feb 29, 2020
0a4b679
20170377 Merged branch BassantNasser with branch master
ahmadkkhaled Mar 1, 2020
a75511b
20170377 Improved presentation of Lucas series
ahmadkkhaled Mar 1, 2020
6c31a1e
20170377 Merged SphereArea with master
ahmadkkhaled Mar 1, 2020
50974c9
20170377 moved class CircleVolum to src
ahmadkkhaled Mar 1, 2020
3b85c41
20170377 Resolved syntax error in Main.java
ahmadkkhaled Mar 1, 2020
2a86bd8
20170377 merged branch mayada-20170304 with bramnch master
ahmadkkhaled Mar 1, 2020
ecf4840
20170377 Removed IDE generated files
ahmadkkhaled Mar 1, 2020
89fbd3f
20170053 just added a comment in his funtion
AshrafSamir Mar 2, 2020
5cc96ee
Merge pull request #1 from AshrafSamir/ashrafBranch
AshrafSamir Mar 2, 2020
9216bd8
adding l
ahmedabdelrhman22 Mar 2, 2020
bf2d2a1
Merge branch 'master' into ahmedabdelrhman
ahmadkkhaled Mar 2, 2020
7f3d8da
20170377 source code files and improved presentation of fibonacci
ahmadkkhaled Mar 2, 2020
76da42c
20170377 Merge branch 'master' of https://github.com/AshrafSamir/git_…
ahmadkkhaled Mar 2, 2020
4931bfb
Create MultiplicationSeries.java
MrwanElHoseny Mar 3, 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
6 changes: 0 additions & 6 deletions .classpath

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
.metadata
bin/
out/
tmp/
*.tmp
*.bak
*.swp
*~.nib
.idea/
local.properties
.settings/
.loadpath
Expand Down
17 changes: 0 additions & 17 deletions .project

This file was deleted.

10 changes: 10 additions & 0 deletions src/Circle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
public class Circle implements ISubscriber{
public void notifySubscriber(String input){
Integer radius = Integer.parseInt(input);
System.out.println("The circle area is: " + calculateArea(radius));
}

private double calculateArea(Integer radius){
return Math.PI * radius * radius;
}
}
7 changes: 7 additions & 0 deletions src/CircleCircumference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
public class CircleCircumference implements ISubscriber{
@Override
public void notifySubscriber(String input){
double radius = Integer.parseInt(input);
System.out.println ("CircleCircumference: "+2*Math.PI*radius);
}
}
6 changes: 6 additions & 0 deletions src/CircleVolum.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class CircleVolum implements ISubscriber{
public void notifySubscriber(String input){
Integer radius = Integer.parseInt(input);
System.out.println ("Circlevolum: "+4/3*Math.PI*radius);
}
}
19 changes: 19 additions & 0 deletions src/Lucas.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
public class Lucas implements ISubscriber {
int tmp[] = {2,1};
@Override
public void notifySubscriber(String input) {
System.out.print("Lucas: ");
int intInput = Integer.parseInt(input);
for (int i=0; i<intInput; i++){
if (i==0) System.out.print(2 + " ");
else if(i==1) System.out.print(1 + " ");
else {
int res = tmp[0] + tmp[1];
tmp[0] = tmp[1];
tmp[1] = res;
System.out.print(res + " ");
}
}
System.out.println(" ");
}
}
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 TwoPowerN(),
new Circle(),
new Shperevolume(),
new CircleCircumference(),
new CircleVolum(),
new Lucas(),
new SphereArea(),
new SphereCircumference(),
new fibonacci()
};
public static void main(String[] args) {
Topic mathTopic = new Topic();
Expand Down
21 changes: 21 additions & 0 deletions src/MultiplicationSeries.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import java.text.DecimalFormat;

public class MultiplicationSeries implements ISubscriber{

public void notifySubscriber(String input) {
DecimalFormat df= new DecimalFormat();
double n= Integer.parseInt(input);
System.out.println("Term "+df.format(n)+" is "+df.format(getTerm(n))+". ");
}

public static double getTerm(double j){
if (j==1) return 1;
if (j==2) return 2;
if (j<=0){
System.out.println("Error");
}
return getTerm(j-1)*getTerm(j-2);

}

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



public class Shperevolume implements ISubscriber {

public void notifySubscriber(String input) {

double redius=Integer.parseInt(input);


double volume = (4*22*redius*redius*redius)/(3*7);
System.out.println("The sphere volume is: " + volume);
}

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

public class SphereArea implements ISubscriber{

@Override
public void notifySubscriber(String input) {
int intInput = Integer.parseInt(input);
double res = 4.0 * 3.14159265359 * intInput * intInput;
System.out.print("The sphere area is : " + res + "\n");
}
}
8 changes: 8 additions & 0 deletions src/SphereCircumference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
public class SphereCircumference implements ISubscriber {
@Override
public void notifySubscriber(String input){
double r = Integer.parseInt(input);
System.out.println ("Circumference of a Sphere: "+2*Math.PI*r);
}

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

//20170053
@Override
public void notifySubscriber(String input) {
int n = Integer.parseInt(input);
int sum = 1;
for(int i=0;i<n;i++){
sum *= 2;
}
System.out.println("2 Power " + n + " equals " + sum);
}
}
15 changes: 15 additions & 0 deletions src/fibonacci.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
public class fibonacci implements ISubscriber {
public void notifySubscriber(String input) {
Integer intinput = Integer.parseInt(input);

int previousNumber = 0;
int nextNumber = 1;
System.out.print("Fibonacci Series of " + intinput + " numbers: ");
for (int i = 1; i <= intinput; ++i) {
System.out.print(previousNumber + " ");
int sum = previousNumber + nextNumber;
previousNumber = nextNumber;
nextNumber = sum;
}
}
}