Lab 2
Due Friday, 9/2 - 11:59pm
Due Friday, 9/2 - 11:59pm
- Write a for loop to print the multiples of 3 from 300 down to 3.
- Implement a class Square. A Square represents the information about a single square of a Sudoku board. A Square has the following data members, and get/set methods for each data member:
- original - a variable of type boolean to indicate whether the value was set in the original puzzle
- set - a variable of type boolean to indicate whether the value has been set by the user, or was set in the original puzzle
- value - a variable of type int to indicate the value stored in the square. if the square has not been set, the value will be 0.
- Implement a class Board that has a 9x9 array of Squares as its data member. Implement a method checkRows in the Board class. checkRows returns true if every row in the array contains a square with each value 1-9. For testing, statically set the values stored in each Square of the array. The signature of the checkRows method is as follows:
- public boolean checkRows();
I have created the following skeleton for the Board class to get you started: Board.java. This contains two helper methods to initialize the board with some test data.
Please submit your work in an SVN directory: https://www.cs.usfca.edu/svn/<username>/cs112/lab2