// Prints a bunch of lines and boxes of asterisks. // Uses methods for each line or box, though the // methods are all very similar. public class MyStarsBad { public static void main(String[] args) { lineOf5(); lineOf12(); lineOf9(); System.out.println(); boxOf5x5(); System.out.println(); boxOf3x7(); System.out.println(); boxOf7x3(); System.out.println(); boxOf10x5(); } public static void lineOf5() { for (int i = 1; i <= 5; i++) { System.out.print("*"); } System.out.println(); } public static void lineOf12() { for (int i = 1; i <= 12; i++) { System.out.print("*"); } System.out.println(); } public static void lineOf9() { for (int i = 1; i <= 9; i++) { System.out.print("*"); } System.out.println(); } public static void boxOf5x5() { for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 5; j++) { System.out.print("*"); } System.out.println(); } } public static void boxOf3x7() { for (int i = 1; i <= 7; i++) { for (int j = 1; j <= 3; j++) { System.out.print("*"); } System.out.println(); } } public static void boxOf7x3() { for (int i = 1; i <= 3; i++) { for (int j = 1; j <= 7; j++) { System.out.print("*"); } System.out.println(); } } public static void boxOf10x5() { for (int i = 1; i <= 5; i++) { for (int j = 1; j <= 10; j++) { System.out.print("*"); } System.out.println(); } } }