// This program produces an ASCII art drawing of a mirror. public class Mirror { public static void main(String[] args) { line(); topHalf(); bottomHalf(); line(); } // Prints a line that appears at the top and bottom of the mirror. public static void line() { // # sign System.out.print("#"); // = signs for (int i = 1; i <= 16; i++) { System.out.print("="); } // # sign System.out.println("#"); } // Prints the top half of the mirror. public static void topHalf() { for (int line = 1; line <= 4; line++) { System.out.print("|"); // spaces for (int i = 1; i <= -2 * line + 8; i++) { System.out.print(" "); } System.out.print("<>"); // dots for (int i = 1; i <= 4 * line - 4; i++) { System.out.print("."); } System.out.print("<>"); // spaces for (int i = 1; i <= -2 * line + 8; i++) { System.out.print(" "); } System.out.println("|"); } } // Prints the bottom half of the mirror. public static void bottomHalf() { for (int line = 4; line >= 1; line--) { System.out.print("|"); // spaces for (int i = 1; i <= -2 * line + 8; i++) { System.out.print(" "); } System.out.print("<>"); // dots for (int i = 1; i <= 4 * line - 4; i++) { System.out.print("."); } System.out.print("<>"); // spaces for (int i = 1; i <= -2 * line + 8; i++) { System.out.print(" "); } System.out.println("|"); } } }