1 package shapes; 2 3 import shapes.SCircle; 4 import shapes.SSquare; 5 6 7 8 9 10 11 public class WhiteSpace { 12 public static void main (String[] args){ 13 14 //cube edgeLength 15 double edgeLength = 16.0; 16 17 //Now find the diameter of the pips 18 double dotDiameter = (edgeLength/6); //This is the diameter. make sure to change it to radius 19 double dotRadius = (dotDiameter/2); 20 21 //Create the die face using NPW 22 SSquare dieFace = new SSquare(edgeLength); 23 //create the black pip using NPW 24 SCircle dieDot = new SCircle(dotRadius); 25 26 27 // die things 28 double AllBlackDots = 1 + 2 + 3 + 4 + 5 + 6; 29 double AllDieFaces = 6.0; 30 31 //calculate the white space by find the area of the pips and substract from die face area 32 double whiteSpace = (dieDot.area() * AllBlackDots)-(dieFace.area() * AllDieFaces); 33 34 //display it 35 System.out.println("The total white space on the entire die is -->" + whiteSpace); 36 37 38 39 40 } 41 42 43 } 44 45 46 47 48 49