1 /* 2 * Assignment 3 Problem 3: Yellow Space 3 */ 4 package shapes; 5 6 7 public class YellowSpace { 8 public static void main (String[] args) { 9 double BSquareL = 400; 10 double BDiamond = 60; 11 double SSquare = 30; 12 double SDiamond = 15; 13 //Large gray square 14 SSquare bigSquare = new SSquare(BSquareL); 15 16 //large yellow diamond inscribing from the a circle that radius of big square minus 60 17 double firstCircleR =bigSquare.side()/2; 18 SCircle firstCircle = new SCircle(firstCircleR-BDiamond); 19 SSquare bigDiamond = firstCircle.inscribingSquare(); 20 21 //small gray square inscribing from the a circle that radius of big diamond minus 30 22 double secondCircleR = bigDiamond.side()/2; 23 SCircle SecondCircle = new SCircle(secondCircleR-SSquare); 24 SSquare smallSquare = SecondCircle.inscribingSquare(); 25 26 //small yellow diamond inscribing from the a circle that radius of Small square minus 15 27 double thirdCircleR = smallSquare.side()/2; 28 SCircle thirdCircle = new SCircle(thirdCircleR-SDiamond); 29 SSquare smallDiamond = thirdCircle.inscribingSquare(); 30 31 //big yellow are is big yellow diamond minus small gray square 32 double yellowarea = ((bigDiamond.area()-smallSquare.area())+smallDiamond.area()); 33 System.out.println("Area of yellow = " + yellowarea ); 34 35 36 } 37 } 38