/* Daniel Nakamura, CSE 142 PROBLEM: Output this figure: SIZE = 3 ////////\\\\\\\\ ////********\\\\ **************** SIZE = 5 ////////////////\\\\\\\\\\\\\\\\ ////////////********\\\\\\\\\\\\ ////////****************\\\\\\\\ ////************************\\\\ ******************************** LOOP TABLES: line / difference expression 1 16 -4 * line -4 * line +20 2 12 3 8 4 4 5 0 line * difference expression 1 0 8 8 * line - 8 2 8 3 16 4 24 5 32 SIZE expression (/) expression size 3 -4 * line + 12 -4 * line + 4 * SIZE 5 -4 * line + 20 7 -4 * line + 28 SIZE expression (*) 3 5 8 * line - 8 7 SOLUTION: */ public class Figure { public static final int SIZE = 5; public static void main(String[] args) { drawFigure(); } public static void drawFigure() { for (int line = 1; line <= SIZE; line++) { for (int slash = 1; slash <= -4 * line + 4 * SIZE; slash++) { System.out.print("/"); } for (int star = 1; star <= 8 * line -8; star++) { System.out.print("*"); } for (int backslash = 1; backslash <= -4 * line + 4 * SIZE; backslash++) { System.out.print("\\"); } System.out.println(); } } }