1 /* 2 * Program to calculate the area of the white part of 3 * a standard 6 sided die 4 */ 5 6 package shapes; 7 8 import java.util.Scanner; 9 10 public class WhiteArea { 11 public static void main(String[] args) { 12 //Create Scanner 13 Scanner scanner = new Scanner(System.in); 14 //Scan for input 15 System.out.println("Please enter the die side length in millimeters."); 16 double sideLength = scanner.nextDouble(); 17 18 SSquare square = new SSquare(sideLength); 19 double circleRatio = 0.0625; 20 SCircle circle = new SCircle(circleRatio*sideLength); 21 22 //calculating face area 23 double totalFaceArea = (6*square.area()); 24 //calculation total dot area 25 double totalDotArea = (21*circle.area()); 26 //calculate total white area 27 double totalWhiteArea = (totalFaceArea-totalDotArea); 28 //print out results 29 System.out.println("Total white area = " + totalWhiteArea + " mm^2"); 30 } 31 32 } 33