1 /* 2 Program to make a yellow and grey tablecloth. 3 */ 4 5 package shapes; 6 7 public class GreySpace { 8 public static void main(String[] args) { 9 10 //Naming the values 11 double TableclothEdge = 750.0; 12 double YellowDistanceToMP = 60.0; 13 double intSquareDistanceToMP = 45.0; 14 15 //Creating the largest square 16 SSquare TableCloth = new SSquare(TableclothEdge); 17 double TableclothArea = (TableclothEdge * TableclothEdge); 18 System.out.println("Tablecloth Area = " + TableclothArea); 19 20 //Inscribing circle to find the radius of the square 21 SCircle Circle1 = TableCloth.inscribingCircle(); 22 23 //Forming a circle around the yellow square 24 SCircle Circle2 = new SCircle (Circle1.radius() - YellowDistanceToMP); 25 26 //Finding the area of the yellow square 27 double YellowSquareArea = (Circle2.radius() * Circle2.radius()); 28 System.out.println("Yellow Diamond Area = " + YellowSquareArea); 29 30 //Using a circle to get the interior square 31 SCircle Circle3 = new SCircle (Circle2.radius() - intSquareDistanceToMP); 32 33 Double IntSquareArea = (Circle3.radius() * Circle3.radius()); 34 System.out.println("Interior Grey Square = " + IntSquareArea); 35 36 //Area of the total amount of grey space 37 Double TotalGreyArea = (TableclothArea + IntSquareArea); 38 System.out.println("Total area of Grey Space = " + TotalGreyArea); 39 } 40 } 41