/* * A program to to compute the area of the yellow space. */ package shapes; import shapes.SCircle; import shapes.SSquare; public class YellowSpace { public static void main (String [] args){ double BigGraySide = 400; double Bigdiamond = 60; double smallsquare = 30; double smalldiamond = 15; double radius1 = (BigGraySide/2)- Bigdiamond; SCircle circle1 = new SCircle(radius1); SSquare bigyellowdiamond = circle1.inscribingSquare(); System.out.println("Area of big yellow diamond = " + bigyellowdiamond.area()); double radius2 = (bigyellowdiamond.side()/2)-smallsquare; SCircle circle2 = new SCircle (radius2); SSquare smallgraysquare = circle2.inscribingSquare(); System.out.println("Area of small gray square = " + smallgraysquare.area()); double radius3 = (smallgraysquare.side()/2)- smalldiamond; SCircle circle3 = new SCircle (radius3); SSquare smallyellowdiamond = circle3.inscribingSquare(); System.out.println("Area of small yellow diamond = " + smallyellowdiamond.area()); double yellowspace = (bigyellowdiamond.area()-smallgraysquare.area())+smallyellowdiamond.area(); System.out.println("Area of Yellow Space = " + yellowspace); } }