// Allison Obourn, CSE 142 // Prints some art made of characters // goal: demonstrate iterative enhancement // start with printlns in main, compile and test. // find first level of structure to clean up main // find redundant sections and clean up into methods. public class Figures1 { public static void main(String[] args) { drawEgg(); drawTeaCup(); drawStopSign(); drawTable(); } // draws an egg public static void drawEgg() { drawTop(); drawBottom(); System.out.println(); } // draws a tea cup public static void drawTeaCup() { drawBottom(); drawLine(); System.out.println(); } // draws a stop sign public static void drawStopSign() { drawTop(); System.out.println("| STOP |"); drawBottom(); System.out.println(); } // draws a table public static void drawTable() { drawTop(); drawLine(); } // draws a half circle opening down public static void drawTop() { System.out.println(" ______"); System.out.println(" / \\"); System.out.println("/ \\"); } // draws a half circle opening up public static void drawBottom() { System.out.println("\\ /"); System.out.println(" \\______/"); } // draws a line public static void drawLine() { System.out.println("+--------+"); } }