/home/sjenks/NetBeansProjects/CS1/src/shapes/RedArea.java
 1 /*
 2  * The goal is to find the area of the red table and square with a blue diamond
 3  * in the middle that is exactly 3 inches from the midpoint of the outer square.
 4  * problem decompision and imaginative construction will be needed. 
 5 */
 6 package shapes;
 7 
 8 /**
 9  *
10  * @author sjenks
11  */
12 public class RedArea {
13 
14     /**
15      * @param args the command line arguments
16      */
17     public static void main(String[] args) {
18         double tableLength = 40.0;
19         SSquare table = new SSquare(tableLength);
20         System.out.println("tableLength = " + tableLength);
21         double distance = 3.0;
22         double blueSquareSide = 34.0;
23         //to create the middle blue square
24         SSquare blueSquare = new SSquare(blueSquareSide);
25         //to create a circle circumscribing the middle blue square
26         SCircle circBlueCircle = blueSquare.circumscribingCircle();
27         // to create a circile inscribing the middle blue square
28         SCircle inscriBlueCircle = blueSquare.inscribingCircle();
29         //to create a smaller circle that is three inches away from the outter 
30         //inscribing circle of the blue square. this is done so you can make 
31         // the inner square three inches from the blue middle one. 
32         SCircle circSmallRedSquare = new SCircle((blueSquareSide/2)-distance);
33         //to create the small red square inscribing a circle. 
34         SSquare smallRedSquare = circSmallRedSquare.inscribingSquare();
35         // to get the table area
36         double areaOfTable = table.area();
37         System.out.println("areaOfTable = " + areaOfTable);
38         //to create the area of the blue square
39         double areaOfBlueSquare = blueSquare.area();
40         System.out.println("areaOfBlueSquare = " + areaOfBlueSquare);
41         //to create area of small square 
42         double areaOfSRedSquare = smallRedSquare.area(); 
43         System.out.println("areaOfSRedSquare = " + areaOfSRedSquare);
44         double totalAreaOfRed = ((areaOfTable - areaOfBlueSquare) + areaOfSRedSquare);
45         System.out.println("totalAreaOfRed = " + totalAreaOfRed);
46         
47         
48         
49     }
50     
51 }
52