// Martson Limsteppkai // CSE 142 Winter 07 // // This program draws several text figures, such as // an egg and a stop sign. // // It uses static methods because the output has a structure // (each figure) and has redundancy (repeated lines between figures). // public class Figures { public static void main(String[] args) { egg(); teacup(); stopSign(); hat(); } public static void egg() { eggTop(); eggBottom(); System.out.println(); } public static void teacup() { eggBottom(); System.out.println("+--------+"); System.out.println(); } public static void stopSign() { eggTop(); System.out.println("| STOP |"); eggBottom(); System.out.println(); } public static void hat() { eggTop(); System.out.println("+--------+"); } public static void eggTop() { System.out.println(" ______"); System.out.println(" / \\"); System.out.println("/ \\"); } public static void eggBottom() { System.out.println("\\ /"); System.out.println(" \\______/"); } }