WhiteArea.java
1    /* 
2    Write a Java program called WhiteArea in the shapes package to compute the white area of a standard white die with black dots given that the edge length of the die is 0.75 inches 
3     and the diameter of each dot is one-eighth the edge length. When you write your program, please keep in mind that a good programmer will generally: 
4     
5        Name the values that serve to define the particular problem instance (edge length and dot diameter, in this case). 
6        Model objects that can be used to solve the problem in a fairly natural way – die face and die dot, in this case). 
7        Strive to present a simple expression of a solution which is grounded in sound problem solving strategies (problem decomposition, in this case). 
8        Clearly, meaningfully, label the program output. 
9     */
10   package shapes;
11   
12   public class WhiteArea {
13       public static void main(String[] args) {
14           SSquare die = new SSquare(0.75);
15           die.side();
16           Double dotDiameter = (die.side()/8);
17           //Double dotDiameter = (die.side()/0.125);
18           System.out.println("Dot Diameter: " + dotDiameter);
19           Double dotRadius = (dotDiameter / 2);
20           System.out.println("Dot radius: " + dotRadius);
21           SCircle dot = new SCircle(dotRadius);
22           Double dieFace = die.area();
23           System.out.println("Die face: " + dieFace);
24           Double dieDot = dot.area();
25           System.out.println("Die dot: " + dieDot);
26           Double whiteAreaLeft = (dieFace - dieDot);
27           System.out.println("White area left: " + whiteAreaLeft);
28   
29       }
30   
31   }
32