1 package shapes; 2 //Tablecloth is 750.0mm each side 3 /* 4 I decided to get middle square I thought making a circle would be a good idea. 5 */ 6 public class GreySpace { 7 public static void main(String[] args) { 8 double bigSquareSide = 750.0; 9 /*Here I am finding the radius of a circle I can inscribe 10 the square inside. To do that I subtract the 60mm on both sides, getting 11 to the point where the square/diamond would touch. Then I divide by 2 because I need radius not 12 diameter. 13 */ 14 double circleOneRadius = ((750.0-(60.0)*2.0)/2.0); 15 SSquare bigGreySquareTableCloth = new SSquare(bigSquareSide); 16 SCircle outlineOne = new SCircle(circleOneRadius); 17 SSquare mediumYellowSquare = outlineOne.inscribingSquare(); 18 /*Now I need to make another circle outline to find the last square. 19 To do this I need the length of a side of the medium square. This minus 45mm on both sides 20 should get me the diameter of the circle outline needed. Then I subtract by two to get 21 the radius which is needed to make the 2nd circle outline. 22 */ 23 double circleTwoRadius = (((mediumYellowSquare.side())-(45)*2)/2); 24 SCircle outlineTwo = new SCircle(circleTwoRadius); 25 SSquare smallGreySquare = outlineTwo.inscribingSquare(); 26 //Now I can calculate the grey area. I subtract small grey area from yellow area. 27 double yellowArea = (mediumYellowSquare.area()-smallGreySquare.area()); 28 //Now I find total grey area, by subtracting only the yellow area from the full TableCloth. 29 double greyAreaOfTableCloth = (bigGreySquareTableCloth.area()-yellowArea); 30 System.out.println("The Grey Area in total of the Table Cloth is " + greyAreaOfTableCloth + " mm"); 31 } 32 } 33