9.1.6 Checkerboard V1 Codehs Link

In this specific CodeHS exercise, you typically edit the file named Checkerboard.java . You are expected to fill in the logic inside the nested for loops to set the color of the Rectangle objects stored in a 2D array.

function start() var row = 1; while (true) // Fill current row var col = 1; while (true) if (row % 2 == 1) if (col % 2 == 1) putBeeper(); else if (col % 2 == 0) putBeeper(); 9.1.6 checkerboard v1 codehs

The outer loop ( row ) tells the program to start at the top and move down. For every single row, the inner loop ( col ) runs across from left to right. This ensures every single coordinate on the grid is visited. 2. The Modulo Operator (%) The line (row + col) % 2 == 0 is the "brain" of the code. % 2 finds the remainder when divided by 2. If the remainder is 0 , the number is even. In this specific CodeHS exercise, you typically edit