// Helene Martin, CSE 142 // Outputs an ASCII mirror. public class MirrorFinal { // number of lines in the top and bottom halves public static final int SIZE = 4; public static void main(String[] args) { drawLine(); drawTop(); drawBottom(); drawLine(); } // displays a line of equal signs public static void drawLine() { System.out.print("#"); for(int i = 1; i <= 4 * SIZE; i++) { System.out.print("="); } System.out.println("#"); } // displays a downward-facing triangle public static void drawTop() { for(int line = 1; line <= SIZE; line++) { System.out.print("|"); for(int spaces = 1; spaces <= line * -2 + SIZE * 2; spaces++) { System.out.print(" "); } System.out.print("<>"); for(int dots = 1; dots <= line * 4 - 4; dots++) { System.out.print("."); } System.out.print("<>"); for(int spaces = 1; spaces <= line * -2 + SIZE * 2; spaces++) { System.out.print(" "); } System.out.println("|"); } } // displays an upward-facing triangle public static void drawBottom() { for(int line = SIZE; line >= 1; line--) { System.out.print("|"); for(int spaces = 1; spaces <= line * -2 + SIZE * 2; spaces++) { System.out.print(" "); } System.out.print("<>"); for(int dots = 1; dots <= line * 4 - 4; dots++) { System.out.print("."); } System.out.print("<>"); for(int spaces = 1; spaces <= line * -2 + SIZE * 2; spaces++) { System.out.print(" "); } System.out.println("|"); } } }