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