/home/akc/NetBeansProjects/CS1/src/shapes/BlackArea.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 BlackArea {
13 
14     /**
15      * @param args the command line arguments
16      */
17     public static void main(String[] args) {
18         // DEFINING VALUES GIVEN IN PROBLEM
19         double tableside = 39;
20         double cardlength = 2.25;
21         double cardwidth = 3.5;
22         double glassbottom = 2.1;
23         
24         // CREATING SHAPES
25         SSquare table = new SSquare(tableside);
26         SRectangle card = new SRectangle(cardlength, cardwidth);
27         SSquare glass = new SSquare(glassbottom);
28         
29         // CREATING THE COASTER
30         SCircle coaster = glass.circumscribingCircle();
31         
32         // SUM OF AREAS
33         double areasum = ((2 * card.area()) + (4 * coaster.area()));
34         
35         // FINDING AREA OF TABLE NOT OBSCURED
36         double tablearea = (table.area() - areasum);
37         
38         // PRINTING THE RESULT
39         System.out.println("Area of table not obscured = " + tablearea);
40     }
41 
42 }
43