/home/sjenks/NetBeansProjects/CS1/src/shapes/WhiteArea.java |
1
2
3
4
5 package shapes;
6
7
8
9 @author
10
11 public class WhiteArea {
12
13
14 @param args
15
16 public static void main(String[] args) {
17 double edgeLength = 1.25;
18 SSquare whiteFace = new SSquare(edgeLength);
19 System.out.println("whiteFace = " + whiteFace.toString());
20 double dotDiameter = ((1.0/7.0) * edgeLength);
21 SCircle dot = new SCircle((dotDiameter)/2);
22 System.out.println("dot" + dot.toString());
23 double whiteFaceArea = whiteFace.area();
24 System.out.println("whiteFaceArea = " + whiteFaceArea);
25 double numOfSides = 6.0;
26 double totalWhiteArea = (numOfSides * whiteFaceArea);
27 System.out.println("totalWhiteArea = " + totalWhiteArea);
28 double dotArea = dot.area();
29 System.out.println("dotArea= " + dotArea);
30 double numOfDots = 21.0;
31 double totalDotArea = (numOfDots * dotArea);
32 System.out.println("totalDotArea = " + totalDotArea);
33 double whiteDieBlackDotArea = (totalWhiteArea - totalDotArea);
34 System.out.println("whiteDieBlackDotArea = " + whiteDieBlackDotArea);
35
36 }
37
38 }
39