/*
   An example of nested loops.

   This program prints out rows containing alternating *'s
   and spaces. How can you modify the program so that it prints
   out a "checkerboard" pattern? That is, have every * above
   and below a space, and visa versa.
*/

public class CheckerBoard1
{
   public static void main( String[] args )
   {
      final int NUMBER_OF_COLUMNS = 16;
      final int NUMBER_OF_ROWS = 8;

      int columnCounter;
      int rowCounter;

      rowCounter = 0;
      while (rowCounter < NUMBER_OF_ROWS) // a counting loop
      {
         columnCounter = 0;
         while (columnCounter < NUMBER_OF_COLUMNS) // another counting loop
         {
            if (columnCounter % 2 == 0 )
               System.out.print("*");
            else
               System.out.print(" ");
            columnCounter++;
         }
         System.out.println(); // start a new line
         rowCounter++;
      }
   }//main()
}