// CSE 142, Aut 06 // Marty Stepp // // This program prints several egg and assorted figures. // Version 3: using methods for the structure and redundancy. // public class GoofyFigures3 { public static void main(String[] args) { drawEgg(); drawTeaCup(); drawStopSign(); drawLastThing(); } // draws redundant part that looks like the top of an egg public static void drawEggTop() { System.out.println(" ______"); System.out.println(" / \\"); System.out.println("/ \\"); } // draws redundant part that looks like the bottom of an egg public static void drawEggBottom() { System.out.println("\\ /"); System.out.println(" \\______/"); } public static void drawEgg() { drawEggTop(); drawEggBottom(); System.out.println(); } public static void drawTeaCup() { drawEggBottom(); System.out.println("+--------+"); // we could have made this a method System.out.println(); } public static void drawStopSign() { drawEggTop(); System.out.println("| STOP |"); drawEggBottom(); System.out.println(); } public static void drawLastThing() { drawEggTop(); System.out.println("+--------+"); } }