forked from mpmenne/launchcode-java-class
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircle.java
More file actions
44 lines (34 loc) · 960 Bytes
/
Copy pathCircle.java
File metadata and controls
44 lines (34 loc) · 960 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
/**
* Created by dshook on 5/6/15.
*/
public class Circle implements Measurable{
private double radius;
public Circle(double r) {
if (r < 0) {
throw new IllegalArgumentException();
}
this.radius = r;
}
@Override
public double getArea() {
return Math.PI * this.radius * this.radius;
}
@Override
public double getPerimeter() {
return 2 * Math.PI * this.radius;
}
public int getNumberOfSides() {
File f = new File("/home/dshook/Documents/launchcode-java-class/InterfacesLecture/src/file.txt");
return 0;
}
public static void main(String[] args) {
Measurable c = new Circle(-5.0);
Measurable s = new Square(5.0);
Measurable[] listOfShapes = new Measurable[10];
listOfShapes[0] = c;
listOfShapes[1] = s;
}
}