/home/ffrigin/NetBeansProjects/CS1/src/shapes/RedArea.java
 1 /*
 2  * Display the red square area.
 3  */
 4 package shapes;
 5 
 6 /**
 7  *
 8  * @author ffrigin
 9  */
10 public class RedArea {
11 
12     /**
13      * @param args the command line arguments
14      */
15     public static void main(String[] args) {
16         //building the table.
17         SSquare table = new SSquare(40);
18         System.out.println("Table Edge Length = " + table.toString());
19         //putting a blue square on.
20         SCircle bclr = table.inscribingCircle();
21         bclr.shrink(3);
22         SSquare bsqr = bclr.inscribingSquare();
23         System.out.println("Blue Square Edge Length = " + bsqr.toString());
24         // adding the Red Square.
25         SCircle rclr = bsqr.inscribingCircle();
26         rclr.shrink(3);
27         SSquare rsqr = rclr.inscribingSquare();
28         System.out.println("Red Square Edge Length = " + rsqr.toString());       
29         double totalArea = table.area() - bsqr.area() + rsqr.area();
30         System.out.println("Red Area = " + totalArea);
31 
32     }
33 
34 }
35