package shapes; public class WhiteArea { public static void main(String[] args){ double edgeLength = 0.75; double dotDiameter = edgeLength * (1/8); SSquare dieFace = new SSquare(edgeLength); SCircle dieDot = new SCircle(dotDiameter); /* Now that we have all the objects we're working with it's important to understand what we're trying to do. If I want to get the area of all of the white parts I need to get the area of the entire face of each die, and subtract that by the dots. thing is, each face has a different number of dots. so, white area of each subsequent side will be subtracted by an additional dot So, I have to calculate each face individually by subtracting the appropirate number of dots, then add each face to get the total area */ double totalFaceArea = dieFace.area(); double totalDotArea = dieDot.area(); //some faces have more dots, hence the multiplication of the area double face1 = totalFaceArea - (totalDotArea * 1); double face2 = totalFaceArea - (totalDotArea * 2); double face3 = totalFaceArea - (totalDotArea * 3); double face4 = totalFaceArea - (totalDotArea * 4); double face5 = totalFaceArea - (totalDotArea * 5); double face6 = totalFaceArea - (totalDotArea * 6); double totalArea = face1 + face2 + face3 + face4 + face5 + face6; System.out.println("The total area of all faces of a standard white die without the black dots is: " + totalArea + " Inches"); } }