WhiteArea.java
1    package shapes;
2    
3    public class WhiteArea {
4    
5    
6    
7        private static double getArea(SRectangle face, SCircle dot) {
8    
9            double areaOfFace = face.area();
10           double areaOfDot = dot.area();
11   
12           //there are 21 dots on a die
13           //6 sides on a die
14           double totalWhiteArea = (6 * areaOfFace) - (21 * areaOfDot);
15   
16           return totalWhiteArea;
17       }
18   
19       public static void main(String[] args) {
20   
21           double sideLength = 0.75;
22           double dotRadius = ((sideLength * 0.125) / 2);
23   
24           SRectangle face = new SRectangle(sideLength, sideLength);
25           SCircle dot = new SCircle(dotRadius);
26   
27           System.out.println("The total white area of a die is " + getArea(face, dot));
28       }
29   
30   
31   
32   
33   }
34