/* Sample program, second iteration of the class, that produces * output with two diamonds and an X. This version has good * structure but still has redundancy. */ public class Figure2 { public static void main(String[] args) { drawDiamond(); drawDiamond(); drawX(); } // Draws a diamond shape out of slashes and backslashes // by printing out ascii art to the console. public static void drawDiamond() { System.out.println(" /\\"); System.out.println(" / \\"); System.out.println("/ \\"); System.out.println("\\ /"); System.out.println(" \\ /"); System.out.println(" \\/"); System.out.println(); } // Draws an X shape out of slashes and backslashes // by printing out ascii art to the console. public static void drawX() { System.out.println("\\ /"); System.out.println(" \\ /"); System.out.println(" \\/"); System.out.println(" /\\"); System.out.println(" / \\"); System.out.println("/ \\"); } }