package eecs1022.finalb; /** * This question is worth 2.5 marks. No partial marks will be awarded for this question. * * @author Franck van Breugel */ public class Question4 { /** * Prints N of the given height. You may assume that the height is at least 3. * See test for sample outputs. * * @param height the height of the N. */ public static void n(int height) { for (int r = 0; r < height; r++) { for (int c = 0; c < height; c++) { if (c == 0 || c == height - 1 || r == c) { System.out.print("*"); } else { System.out.print(" "); } } System.out.println(); } } /** * Tests method. You may add more test cases. * * @param args not applicable. */ public static void main(String[] args) { Question4.n(3); System.out.println(); Question4.n(4); System.out.println(); Question4.n(5); System.out.println(); Question4.n(6); System.out.println(); Question4.n(7); System.out.println(); } }