1 package shapes; 2 import javax.swing.SwingUtilities; 3 import painter.SPainter; 4 import java.awt.Color; 5 import javax.swing.SwingUtilities; 6 import shapes.SCircle; 7 import shapes.SSquare; 8 public class YellowSpace { 9 public static void main(String[] args) { 10 //constants 11 SPainter TesterBoi = new SPainter("Yellow Space", 400, 400); 12 double BigGrayE = 400; 13 double FirstGap = 60; 14 double SecondGap = 30; 15 double ThirdGap = 15; 16 SSquare BigGray = new SSquare(BigGrayE); 17 SCircle BigYellowC = new SCircle(BigGrayE/2 - FirstGap); 18 SSquare BigYellowS = BigYellowC.inscribingSquare(); 19 System.out.println(BigYellowS.side()); 20 double BigYellowE = BigYellowS.side(); 21 SCircle LilGrayC = new SCircle(BigYellowE/2 - SecondGap); 22 SSquare LilGrayS = LilGrayC.inscribingSquare(); 23 System.out.println(LilGrayS.side()); 24 double LilGrayE = LilGrayS.side(); 25 SCircle LilYellowC = new SCircle(LilGrayE/2 - ThirdGap); 26 SSquare LilYellowS = LilYellowC.inscribingSquare(); 27 System.out.println(LilYellowS.side()); 28 //areas 29 double BigYellowArea = BigYellowS.area(); 30 double LilGrayArea = LilGrayS.area(); 31 double LilYellowArea = LilYellowS.area(); 32 //Calc 33 double TotalGray = ((BigYellowArea + LilYellowArea) - LilGrayArea); 34 System.out.println("The Final Value of Yellow Area is:"); 35 System.out.println("{ "+TotalGray+" }"); 36 TesterBoi.setColor(Color.GRAY); 37 TesterBoi.paint(BigGray); 38 TesterBoi.tl(45); 39 TesterBoi.setColor(Color.yellow); 40 TesterBoi.paint(BigYellowS); 41 TesterBoi.tl(45); 42 TesterBoi.setColor(Color.GRAY); 43 TesterBoi.paint(LilGrayS); 44 TesterBoi.tl(45); 45 TesterBoi.setColor(Color.yellow); 46 TesterBoi.paint(LilYellowS); 47 } 48 } 49