Checkerboard Version 1 ... Enter size:> 6 ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ******------******------******------ ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** ------******------******------****** |
Checkerboard Version 1 ... Enter size:> 3 ***---***--- ***---***--- ***---***--- ---***---*** ---***---*** ---***---*** ***---***--- ***---***--- ***---***--- ---***---*** ---***---*** ---***---*** |
Observe that the program prompts the user to enter a single integer value, which serves to describe the size of the checkerboard that the program is to "draw". This single size value dictates not only the number of rows and columns in the checkerboard, but also the size of each square within the checkerboard. Note that if the size value is odd, the number of rows and columns is adjusted to the next higher even number. (E.g., Notice that, in the illustration on the right, where the input value is three, the resulting checkerboard has four rows and four columns. The size of each square should be 3-by-3, however.)
This assignment is primarily about formulating for loops and methods with parameters. However, you also are expected to continue applying the concepts of procedural decompositon/modularization.
|
|
There is no point in submitting any ".class" files. If, after submitting a source code file, you make improvements or corrections to it, you can submit it again (and again, etc.). Normally, only the last version of a file that you submit will be graded.