1 /* 2 * A program that computes the area of the yellow space as illustrated in the Grey and Yellow Tablecloth problem 3 */ 4 5 package shapes; 6 7 public class YellowSpace { 8 public static void main(String[] args) { 9 // Given information 10 double sideLength= 800; // side length of grey tablecloth 11 double midPointYellow=80; //corners of the yellow square are exactly 80mm from the midpoints of the sides of the tablecloth square 12 double midPointGrey=40; //corners of the interior gray square are exactly 40mm from the midpoints of the sides of the yellow square 13 14 SSquare tablecloth = new SSquare (sideLength); //creating tablecloth 15 16 //Imaginative Construction: Making a circle around the center yellow diamond 17 double yellowCircleDiameter= sideLength - (2* midPointYellow); //multiplying the midPoint of the yellow diamond to find the diameter 18 double yellowCircleRadius= yellowCircleDiameter/2; 19 20 SCircle innerYellowCircle = new SCircle (yellowCircleRadius); 21 SSquare yellowDiamond = innerYellowCircle.inscribingSquare(); 22 23 //Imaginative Construction: Making a circle around the center grey square 24 double greyCircleDiameter= yellowDiamond.side() - (2*midPointGrey); 25 double greyCircleRadius= greyCircleDiameter/2; 26 27 SCircle innerGreyCircle = new SCircle (greyCircleRadius); 28 SSquare greySquare = innerGreyCircle.inscribingSquare(); 29 30 //Area of yellow diamond 31 double yellowArea = yellowDiamond.area()-greySquare.area(); 32 System.out.println("The area of the yellow diamond is:" + yellowArea); 33 } 34 } 35