WhiteArea.java
1    package shapes;
2    
3    /*notes: on a dice there are 21 dots in all. 
4    *on a dice there are 6 sides 
5    *edge length of this die is 19mm 
6    * diameter of a dot is 1/8 of 19mm 
7    * I will need radius of dot so I will need to divide diameter by 2 
8     */
9    public class WhiteArea {
10       public static void main(String[] args) {
11           double numberOfDots = (21.0);
12           double numberOfSides = (6.0);
13           double edgeLength = (19.0);
14           //each dot is 1/8 so /8 of 19 so 19/8 in diameter.
15           //1/2 is added to find radius which is needed.
16           double radiusOfDot = (((19.0)/8.0)/2.0);
17           SSquare diceFace = new SSquare(edgeLength);
18           SCircle dot = new SCircle(radiusOfDot);
19           double areaOfAllDots = (numberOfDots*(dot.area()));
20           double areaOfAllSides = (numberOfSides*(diceFace.area()));
21           double areaOfWhiteSpaceDie = (areaOfAllSides-areaOfAllDots);
22           System.out.println("The total area of white space on the die = " + areaOfWhiteSpaceDie + " mm");
23   
24       }
25   }
26