// Zorah Fung // CSE 142, January 6, 2017 // This program prints out two diamonds and an X using ASCII characters // // Note: This is the completed version in which we both capture // structure and eliminate internal redundancy public class FiguresFinalVersion { public static void main(String[] args) { drawDiamond(); drawDiamond(); drawX(); } // Prints out a diamond public static void drawDiamond() { drawCaretTop(); drawV(); System.out.println(); } // Prints an X public static void drawX() { drawV(); drawCaretTop(); } // Prints a V public static void drawV() { System.out.println("\\ /"); System.out.println(" \\ /"); System.out.println(" \\/"); } // Prints a caret public static void drawCaretTop() { System.out.println(" /\\"); System.out.println(" / \\"); System.out.println("/ \\"); } }