// Tyler Rigsby, CSE 142 // Prints several lines and several boxes of stars public class Stars2 { public static void main(String[] args) { printLine(13); printLine(7); printLine(35); printBox(10, 5); printBox(5, 6); } // prints a line of stars with the specified length. public static void printLine(int length) { repeatText("*", length); System.out.println(); } // prints a box with the specified width and height public static void printBox(int width, int height) { printLine(width); for (int line = 1; line <= height - 2; line++) { System.out.print("*"); repeatText(" ", width - 2); System.out.println("*"); } printLine(width); } // prints the specified text the specified number of times public static void repeatText(String text, int number) { for (int i = 1; i <= number; i++) { System.out.print(text); } } }