Nested Loops Projects

 

Nested Loop Starter Code

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()

screenshot.1416


Method 2 and 3)

diagAndBrders()                                                    noDiag()

diagonal_only                      diagonal


Method 4)

printMultiplicationTable()

 

multiplication-table-console-view