// Sample program that draws various lines and boxes. This is a // poorly structured program with a lot of redundancy. public class Stars { public static void main(String[] args) { line(13); int seven = 7; line(seven); line(35); box(5, 10); box(5, 6); int x = 5; int y = x; x = 10; } public static void line(int count) { for (int i = 1; i <= count; i++) { System.out.print("*"); } System.out.println(); } public static void box(int width, int height) { line(width); for (int line = 1; line <= height - 2; line++) { System.out.print("*"); for (int space = 1; space <= width - 2; space++) { System.out.print(" "); } System.out.println("*"); } line(width); } }