WhiteArea.java
1    package shapes;
2    
3    public class WhiteArea {
4        public static void main(String[] args) {
5            //edge length of die is 0.75, and the diameter is 1/8 the edge length
6            double edgeLength = 0.75;
7            double diameterOfDot = (edgeLength/8.0);
8    
9            //The properties of a die are: 6 faces and 21 (1+2+3+4+5+6) dots total
10           //A single die face
11           SSquare dieFace = new SSquare (0.75);
12           //A single die dot
13           SCircle dieDot = new SCircle ((diameterOfDot/2.0));
14   
15           //Total area of all the faces of the die
16           double totalAreaOfDieFaces = (dieFace.area()*6.0);
17           double totalAreaOfDieDots = (dieDot.area()*21.0);
18   
19           //Area of WhiteArea
20           double WhiteArea = (totalAreaOfDieFaces - totalAreaOfDieDots);
21   
22           System.out.println("The white area of a standard die is " + WhiteArea);
23   
24       }
25   }
26