// Yazzy Latif // 07/01/2020 // TA: Grace Hopper // Mirror // This program prints out an ASCII art mirror. public class Mirror { public static final int SIZE = 3; public static void main(String[] args) { drawLine(); drawTopHalf(); drawBottomHalf(); drawLine(); } // Prints the borders of the mirror public static void drawLine() { System.out.print("#"); for (int i = 1; i <= 4 * SIZE; i++) { System.out.print("="); } System.out.println("#"); } // Prints out top half of mirror image public static void drawTopHalf() { for (int line = 1; line <= SIZE; line++) { System.out.print("|"); for (int spaces = 1; spaces <= -2 * line + (2 * SIZE); spaces++) { System.out.print(" "); } System.out.print("<>"); for (int dots = 1; dots <= 4 * line - 4; dots++) { System.out.print("."); } System.out.print("<>"); for (int spaces = 1; spaces <= -2 * line + (2 * SIZE); spaces++) { System.out.print(" "); } System.out.println("|"); } } // prints out bottom half of the mirror image public static void drawBottomHalf() { for (int line = SIZE; line >= 1; line--) { int adjustLine = SIZE - line + 1; System.out.print("|"); for (int spaces = 1; spaces <= -2 * line + (2 * SIZE); spaces++) { System.out.print(" "); } System.out.print("<>"); for (int dots = 1; dots <= 4 * line - 4; dots++) { System.out.print("."); } System.out.print("<>"); for (int spaces = 1; spaces <= -2 * line + (2 * SIZE); spaces++) { System.out.print(" "); } System.out.println("|"); } } }