// Helene Martin, CSE 142 // Draws lines and boxes of stars. public class Stars1 { public static void main(String[] args) { line(13); line(7); line(35); box(10, 5); box(5, 6); box(3, 3); repeat("WEEKEND!", 142); } // prints times copies of the str String public static void repeat(String str, int times) { for (int i = 1; i <= times; i++) { System.out.print(str); } } // prints a line of stars asterisks public static void line(int stars) { for (int i = 1; i <= stars; i++) { System.out.print("*"); } System.out.println(); } // prints a box of width x height asterisks 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); } }