// Helene Martin, CSE 142 // Prints some shapes made of characters // goal: this version of the program demonstrates using // static methods to reduce redundancy and capture // internal structure. public class Figures2 { public static void main(String[] args) { drawHexagon(); drawBucket(); drawStopSign(); drawTurtle(); } public static void drawTop() { System.out.println(" ______"); System.out.println(" / \\"); System.out.println("/ \\"); } public static void drawBottom() { System.out.println("\\ /"); System.out.println(" \\______/"); } public static void drawLine() { System.out.println("+--------+"); } public static void drawHexagon() { drawTop(); drawBottom(); System.out.println(); } public static void drawBucket() { drawBottom(); drawLine(); System.out.println(); } public static void drawStopSign() { drawTop(); System.out.println("| STOP |"); drawBottom(); System.out.println(); } public static void drawTurtle() { drawTop(); drawLine(); } }