1 /*Compute the yellow area 2 3 */ 4 5 package shapes; 6 7 public class YellowSpace { 8 public static void main(String[] args) { 9 10 SSquare LG = new SSquare(400); 11 SSquare LY = new SSquare(Math.hypot(140, 140)); 12 SSquare SG = new SSquare(Math.hypot(((LY.side()/2) - 30),(LY.side()/2) - 30)); 13 SSquare SY = new SSquare(Math.hypot(((SG.side()/2) - 15),(SG.side()/2) - 15)); 14 15 System.out.println("Side LG = " + LG.toString()); 16 System.out.println("Side LY = " + LY.toString()); 17 System.out.println("Side SG = " + SG.toString()); 18 System.out.println("Side SY = " + SY.toString()); 19 20 System.out.println("Yellow area = " + (SY.area() + (LY.area() - SG.area()))); 21 22 23 } 24 } 25