Nested Loop Starter Code
1 2 3 4 5 6 7 8 9 10 11 12 |
void nestedLoopDemo(){ for (int row = 1 ; row <= 4 ; row++) { System.out.print("row "+ row + " : ") ; for (int star = 1 ; star <= row ; star++) { System.out.print("* ") ; } System.out.println() ; } } |
Method 1) printRectangle()
Change the code from the demonstration of nested loops so that you output the following pattern below. Call this method printSqure()
Method 2 and 3)
diagAndBrders() noDiag()
Method 4)
printMultiplicationTable()