ITEC 120 LAB 10 Back to Lab index page

Nested loops

Download and run the program Stars.java. Study how the nested for loops are working.

Add to your program loops to create the following patterns:

**********
*********
********
*******
******
*****
****
***
**
*

**********
 *********
  ********
   *******
    ******
     *****
      ****
       ***
        **
         *

         *
        **
       ***
      ****
     *****
    ******
   *******
  ********
 *********
**********

Extra Credit - for 2 points extra credit, create this pattern as well:

     *
    ***
   *****

  *******
 *********

 *********
  *******
   *****
    ***
     *


Once you have your program working, show your lab to the Peer Instructor to be checked off.