Site Map
Useful Tools
Graphing Calc

Scientific Calculator

Nested Loops in Java

Student Labs 1

  • Change the code from the demonstration of nested loops so that you output the following pattern below
  • Write the code that will produce the multiplication table between 1 and 100 as shown in the picture below. I have given you part of the code. Look in the code immediately below this picture. Your job is to figure out what should replace the red question marks(?).
    The code below is incomplete. Figure out what values for the loops will produce the multiplication table.
    for( int factor1 = ?; factor1 <= ?; factor1++ ){
    	for (int factor2 = ?; factor2 <=? ; factor2 ++){
    			System.out.print(? * ? + "  ");

    Programming Project 1)

  • Below is an example of the print out that you were asked to create with a double loop in the first set of student projects
  • First Lab's Output   New output

Programming Project 2)

Write a nested loop to produce the image on the right
Programming Project 3)
    Write a nested loop that produces the image below
    One of your loops must be a while loop