// Zorah Fung, CSE 142 // This program prints out several lines of stars of various lengths // and several boxes of stars of various widths and heights public class StarsFinal { public static void main(String[] args) { line(13); line(7); line(35); box(10, 5); box(5, 6); box(3, 3); } // prints a line of the given number of stars public static void line(int stars) { for (int i = 1; i <= stars; i++) { System.out.print("*"); } System.out.println(); } // prints a box of stars of the given width and height 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); } }