/home/kchan2/NetBeansProjects/CS1/src/shapes/BlackArea.java
 1 /*
 2  * A program to display the area of the table that is not obscured by 
 3  * some objects (a deck or a coaster).
 4  */
 5 package shapes;
 6 
 7 /**
 8  *
 9  * @author kchan2
10  */
11 public class BlackArea {
12 
13     /**
14      * @param args the command line arguments
15      */
16     public static void main(String[] args) {
17         double sideOfCardTable = 39;
18         double widthOfDeck = 2.25;
19         double lengthOfDeck = 3.5;
20         double sideOfSquareBottomGlass = 2.1;
21         SSquare cardTable = new SSquare(sideOfCardTable);
22         SRectangle deck = new SRectangle(widthOfDeck,lengthOfDeck);
23         SSquare squareBottomGlass = new SSquare(sideOfSquareBottomGlass);
24         SCircle coaster = squareBottomGlass.inscribingCircle();
25         double collectiveAreaOfObjects = 
26                 (deck.area()*2) + (coaster.area()*4);
27         double areaOfTableNotObscuredByObjects = 
28                 cardTable.area() - collectiveAreaOfObjects;
29         System.out.println(
30                 "The area of the table not obscured by the objects which sit on top "
31                 + "of it = " + areaOfTableNotObscuredByObjects
32                 + " square inches");
33         
34     }
35     
36 }
37