1 package shapes; 2 3 public class WhiteArea { 4 5 public static void main(String[] args) { 6 7 //Constants 8 double edgeWidth = 0.75; 9 double dotDiameter = edgeWidth/8; 10 double dotRadius = dotDiameter/2; 11 double amountOfDots = 21; 12 double amountOfFaces = 6; 13 14 15 //Object Instantiations 16 SSquare diceFace = new SSquare(edgeWidth); 17 SCircle diceDot = new SCircle(dotRadius); 18 19 //Area Calculations 20 double netDiceFaceArea = diceFace.area() * amountOfFaces; 21 double netDotArea = (diceDot.area() * amountOfDots); 22 23 //White Space Available 24 double netDiceWhiteSpace = netDiceFaceArea - netDotArea; 25 26 //Print Statements 27 System.out.println("-------------------------------------------------"); 28 System.out.println("Faces in a Dice: " + amountOfFaces); 29 System.out.println("Dots in a Dice: " + amountOfDots); 30 System.out.println("-------------------------------------------------"); 31 System.out.println("Area of Dice Faces: " + netDiceFaceArea); 32 System.out.println("Area Covered By Dots: " + netDotArea); 33 System.out.println("White Space Available: " + netDiceWhiteSpace); 34 System.out.println("-------------------------------------------------"); 35 System.out.println("Calculation: " + netDiceFaceArea + " - " + netDotArea + " = " + netDiceWhiteSpace ); 36 37 } 38 39 } 40