/home/akc/NetBeansProjects/CS1/src/shapes/WhiteArea.java
 1 /*
 2  * This program affords opportunities to explore the computational solution to
 3  * simple geometrical problems by means of the construction and use of basic
 4  * shapes.
 5  */
 6 package shapes;
 7 
 8 /**
 9  *
10  * @author akc
11  */
12 public class WhiteArea {
13 
14     /**
15      * @param args the command line arguments
16      */
17     public static void main(String[] args) {
18         // DEFINING VALUES FOR 1 SIDE
19         double edgelength = 1.25;
20         double dotdiameter = (double)edgelength / (double)7;
21         double dotradius = (double)dotdiameter / (double) 2;
22 
23         // MODELED OBJECTED
24         SSquare dieface = new SSquare(edgelength);
25         SCircle diedot = new SCircle(dotradius);
26 
27         // SUM OF BLACK DOTS AREA - 6 SIDES TO A DIE (WITH INCREASING NUMBER OF 
28         // BLACK DOTS)[1+2+3+4+5+6 = 21]
29         double blackarea = ((21 * diedot.area()));
30 
31         // SOLUTION (6 SIDES TO A DIE - SO 6 "FACES")
32         double whitearea = ((6*dieface.area()) - blackarea);
33 
34         // PRINTING THE SOLUTION
35         System.out.println("There is a white die with black dots. The white "
36                 + "area of the die is " + whitearea);
37     }
38 
39 }
40