/home/ssingh6/NetBeansProjects/CS1/src/shapes/WhiteArea.java |
1
2
3
4
5
6 package shapes;
7 import shapes.SSquare;
8 import shapes.SCircle;
9
10
11
12 @author
13
14 public class WhiteArea {
15
16
17 @param args
18
19 public static void main(String[] args) {
20 double edgeLength= 1.25;
21 double dotDiameter= (((double)1/7)*1.25);
22 double dotRadius= (dotDiameter/2);
23 SSquare dieFace = new SSquare(edgeLength);
24 SCircle dieDot = new SCircle(dotRadius);
25 double dotArea= 21*dieDot.area();
26 double totalArea = 6*dieFace.area();
27 double whiteArea= totalArea-dotArea;
28
29
30 System.out.println("dot diameter"+ dotDiameter);
31 System.out.println("Total Area of White die= "+totalArea);
32 System.out.println("White Area of White die= "+whiteArea);
33 System.out.println("Black Area of White die="+ dotArea);
34 }
35
36 }
37