5. Checkerboard Write a program that takes a psotive integer n and displays n x
ID: 3924332 • Letter: 5
Question
5. Checkerboard
Write a program that takes a psotive integer n and displays n x n checkerboard. For example, when n = 5, the program displays as in Figure15-30. Make sure that adjacent squares differ in color regardless of whether n is odd or even. Write the program in such a way that it works for different values of n by changing only one line in your code. Hint: Use un-editable TextField objects in a GridPane, and use CSS to set background colors.
Figure 15-30 Checkerboard (Mark Schrier. Copyright Oracle, Inc.) Checker… -