/home/ssingh6/NetBeansProjects/CS1/src/shapes/RedArea.java
 1 /*
 2  * To change this license header, choose License Headers in Project Properties.
 3  * To change this template file, choose Tools | Templates
 4  * and open the template in the editor.
 5  */
 6 package shapes;
 7 
 8 
 9 /**
10  *
11  * @author ssingh6
12  */
13 
14  
15  public class RedArea {
16  
17     
18      public static void main(String[] args) {
19         double edgeLength = 40;
20         double distance = 3;
21         SSquare table = new SSquare(edgeLength);
22         SCircle inscribeOfTable = table.inscribingCircle();
23         inscribeOfTable.shrink(distance);
24         SSquare blueSquare = inscribeOfTable.inscribingSquare();
25         SCircle inscribeOfBlueSquare = blueSquare.inscribingCircle();
26         inscribeOfBlueSquare.shrink(distance);
27         SSquare interiorRedSquare = inscribeOfBlueSquare.inscribingSquare();
28         double areaOfTable = table.area();
29         double areaOfBlueSquare = blueSquare.area();
30         double areaOfInteriorRedSquare = interiorRedSquare.area();
31         double redArea = 
32                 ((areaOfTable - areaOfBlueSquare) + areaOfInteriorRedSquare);
33         System.out.println(
34          "The red area of the table = " + redArea + " square inches");
35        
36      }
37      
38  }
39 
40 
41