/home/evankemp/NetBeansProjects/CS1/src/shapes/RedArea.java
 1 /*
 2  * Computing the red area of a table.
 3  */
 4 package shapes;
 5 
 6 import static java.awt.Color.BLACK;
 7 import static java.awt.Color.BLUE;
 8 import static java.awt.Color.RED;
 9 import painter.SPainter;
10 
11 /**
12  *
13  * @author evankemp
14  */
15 public class RedArea {
16 
17     /**
18      * @param args the command line arguments
19      */
20     public static void main(String[] args) {
21         //INTRODUCING RELEVANT DATA
22         int tableSide = 40;
23         int distance = 3;
24         
25         //CREATING THE BIG RED AND THE BLUE SQUARES
26         int circleRadius1 = ((tableSide/2)-distance);
27         SSquare redTable = new SSquare(tableSide);
28         SCircle medium = new SCircle(circleRadius1);
29         SSquare blueSquare = medium.inscribingSquare();
30         
31         //CREATING THE LITTLE RED SQUARE
32         double smallRadius = ( (blueSquare.side()/2.0) - distance);
33         SCircle small = new SCircle(smallRadius);
34         SSquare redSmallSquare = small.inscribingSquare();
35         
36         //COMPUTING THE RED AREA
37         double redArea = ((redTable.area()- blueSquare.area() )
38                 + redSmallSquare.area());
39     
40         //SOLUTION!
41         System.out.println("The red area of the table is " + redArea 
42                 + " inches squared.");
43         
44                 
45     }
46     
47 }
48