// Sample program that produces output with two diamonds and an X. This // version has good structure and eliminates redundancy. public class Figure3 { public static void main(String[] args) { drawDiamond(); drawDiamond(); drawX(); } public static void drawDiamond() { drawHalf1(); drawHalf2(); System.out.println(); } public static void drawX() { drawHalf2(); drawHalf1(); } public static void drawHalf1() { System.out.println(" /\\"); System.out.println(" / \\"); System.out.println("/ \\"); } public static void drawHalf2() { System.out.println("\\ /"); System.out.println(" \\ /"); System.out.println(" \\/"); } }