// Miya Natsuhara // 07-03-2019 // CSE142 // TA: Grace Hopper // This program prints out an ASCII art tapestry. /* DEVELOPMENT NOTES: ((Note: this is not something you should include in your own programs; this is included here to aid in your understanding and to provide additional context for the program.)) This was our initial version of the program, for the default size 4. The work to find the correct expressions to use in for loops to create the patterns of spaces and dots in the top and bottom halves can be found in tapestry_scratch.txt. */ public class Tapestry1 { public static void main(String[] args) { drawFringe(); drawTopHalf(); drawBottomHalf(); drawFringe(); } // prints out the fringe of the tapestry public static void drawFringe() { System.out.print("#"); for (int equals = 1; equals <= 16; equals++) { System.out.print("="); } System.out.println("#"); } // prints out the top half of the tapestry public static void drawTopHalf() { for (int line = 1; line <= 4; line++) { System.out.print("|"); for (int space = 1; space <= -2 * line + 8; space++) { System.out.print(" "); } System.out.print("<>"); for (int dot = 1; dot <= 4 * line - 4; dot++) { System.out.print("."); } System.out.print("<>"); for (int space = 1; space <= -2 * line + 8; space++) { System.out.print(" "); } System.out.println("|"); } } // prints out the bottom half of the tapestry public static void drawBottomHalf() { for (int line = 4; line >= 1; line--) { System.out.print("|"); for (int space = 1; space <= -2 * line + 8; space++) { System.out.print(" "); } System.out.print("<>"); for (int dot = 1; dot <= 4 * line - 4; dot++) { System.out.print("."); } System.out.print("<>"); for (int space = 1; space <= -2 * line + 8; space++) { System.out.print(" "); } System.out.println("|"); } } }