/* Java program (taken from pages 20-21 of Reges & Stepp (3rd ed.)) that ** draws text figures (a diamond, an X, and a rocket ship). ** This (first) version neither "captures structure" nor eliminates redundancy. ** That is, the program's structure (or lack thereof, as its body consists of ** a monolithic main() method) fails to reflect that of the task that it ** carries out, which has three obvious sub-tasks (namely, to print a diamond, ** to print an 'X', and to print a rocket ship). As for redundancy, notice ** that several short segments of println() statements are repeated multiple ** times. */ public class DrawFigures1 { /** Draws a few figures: diamond-shaped, X-shaped, and rocket-shaped. */ public static void main(String[] args) { System.out.println(" /\\"); System.out.println(" / \\"); System.out.println(" / \\"); System.out.println(" \\ /"); System.out.println(" \\ /"); System.out.println(" \\/"); System.out.println(); System.out.println(" \\ /"); System.out.println(" \\ /"); System.out.println(" \\/"); System.out.println(" /\\"); System.out.println(" / \\"); System.out.println(" / \\"); System.out.println(); System.out.println(" /\\"); System.out.println(" / \\"); System.out.println(" / \\"); System.out.println("+------+"); System.out.println("| |"); System.out.println("| |"); System.out.println("+------+"); System.out.println("|United|"); System.out.println("|States|"); System.out.println("+------+"); System.out.println("| |"); System.out.println("| |"); System.out.println("+------+"); System.out.println(" /\\"); System.out.println(" / \\"); System.out.println(" / \\"); } }