forked from profjpbaugh/complete-java-developer-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircleDemo.java
More file actions
23 lines (20 loc) · 704 Bytes
/
Copy pathCircleDemo.java
File metadata and controls
23 lines (20 loc) · 704 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class CircleDemo {
public static void main(String[] args) {
Circle unitCircle = new Circle();
Circle myCircle = new Circle(5);
Circle yourCircle = new Circle(12.75);
printCircleData(unitCircle);
printCircleData(myCircle);
printCircleData(yourCircle);
}//end main
public static void printCircleData(Circle circle) {
System.out.println("r = " + circle.getRadius());
System.out.println("C = " +
String.format("%.2f",circle.circumference())
);
System.out.println("A = " +
String.format("%.2f", circle.area())
);
System.out.println();
}//end printCircleData
}//end CircleDemo