CMPS 134 Fall 2022
Prog. Assg. #3: Checkerboard Drawing
Due: 11:59:59pm, Wednesday, October 12

Requirements

Checkerboard Version 1 ...
Enter size:> 6
******------******------******------
******------******------******------
******------******------******------
******------******------******------
******------******------******------
******------******------******------
------******------******------******
------******------******------******
------******------******------******
------******------******------******
------******------******------******
------******------******------******
******------******------******------
******------******------******------
******------******------******------
******------******------******------
******------******------******------
******------******------******------
------******------******------******
------******------******------******
------******------******------******
------******------******------******
------******------******------******
------******------******------******
******------******------******------
******------******------******------
******------******------******------
******------******------******------
******------******------******------
******------******------******------
------******------******------******
------******------******------******
------******------******------******
------******------******------******
------******------******------******
------******------******------******
Checkerboard Version 1 ...
Enter size:> 3
***---***---
***---***---
***---***---
---***---***
---***---***
---***---***
***---***---
***---***---
***---***---
---***---***
---***---***
---***---***
For this assignment you are to complete the development of the Java program CheckerboardV1 so that it behaves as illustrated in the accompanying illustrations (in which input supplied by the user is shown in blue).

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.

Additional/Optional

After you have completed and submitted your work on the assignment as specified above, you are encouraged to consider completing a second version of the program, called CheckerboardV2. This version provides the user greater control over the "shape" of the checkerboard that is drawn. Specifically, in addition to providing the size of the board (in terms of its number of rows and columns), the user must also provide the width and height of each square. See the following illustrations for details.

Checkerboard Version 2 ...
Enter size:> 6
Enter width:> 3
Enter height:> 4
***---***---***---
***---***---***---
***---***---***---
***---***---***---
---***---***---***
---***---***---***
---***---***---***
---***---***---***
***---***---***---
***---***---***---
***---***---***---
***---***---***---
---***---***---***
---***---***---***
---***---***---***
---***---***---***
***---***---***---
***---***---***---
***---***---***---
***---***---***---
---***---***---***
---***---***---***
---***---***---***
---***---***---***
Checkerboard Version 2 ...
Enter size:> 3
Enter width:> 8
Enter height:> 5
********--------********--------
********--------********--------
********--------********--------
********--------********--------
********--------********--------
--------********--------********
--------********--------********
--------********--------********
--------********--------********
--------********--------********
********--------********--------
********--------********--------
********--------********--------
********--------********--------
********--------********--------
--------********--------********
--------********--------********
--------********--------********
--------********--------********
--------********--------********

Submission of Program(s)

After completing the program, which must be in a file named CheckerboardV1.java, submit it to the appropriate folder (named something like Prog. Assg. #3) using the Student File Submission/Retrieval Utility, a link to which appears on the CMPS 134 course web page. If you also completed CheckerboardV2.java, submit that, too.

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.