// CSE 142, Autumn 09 // Marty Stepp // This program prints some beautiful ASCII art figures. public class Figures { public static void main(String[] args) { // draws the four figures egg(); System.out.println(); cup(); System.out.println(); stopSign(); System.out.println(); hat(); } // The next four methods print the main four figures in the output. // They are here to represent the structure of the program, so that // the main method is a concise summary. public static void egg() { eggTop(); eggBottom(); } public static void cup() { eggBottom(); line(); } public static void stopSign() { eggTop(); System.out.println("| STOP |"); eggBottom(); } public static void hat() { eggTop(); line(); } // The next three methods print partial figures. They are here // to eliminate redundancy. public static void eggTop() { System.out.println(" ______"); System.out.println(" / \\"); System.out.println("/ \\"); } public static void eggBottom() { System.out.println("\\ /"); System.out.println(" \\______/"); } public static void line() { System.out.println("+--------+"); } }