1 /* 2 Set of code to calculate the total white area in a die. 3 Length of die: 0.75 inches 4 Diameter of dot: one-eight of the length of die. 5 */ 6 7 package shapes; 8 9 public class WhiteArea { 10 public static void main(String[] args) { 11 12 double side = 0.75; // setting a variable for dimension of edge of die. 13 14 SSquare die = new SSquare(0.75); // created the face of my die. 15 SCircle dot = new SCircle((side/8)/2); // size of the black dot on the die. 16 17 double a = die.area(); // setting a variable for the area of the entire face of die 18 double d = dot.area(); // setting a variable for the area of dot 19 20 double one = (a - d); // calculating the white area of the face with one dot 21 double two = (a - (2*d)); // white area with two dots 22 double three = (a - (3*d)); // white area with three dots 23 double four = (a - (4*d)); // white area with four dots 24 double five = (a - (5*d)); // white are with five dots 25 double six = (a - (6*d)); // white area with six dots 26 27 double white = (one + two + three + four + five + six); // sum of all white areas 28 System.out.println("White Area of a Die = " + white); 29 30 } 31 } 32