In the first part of this lab you need to implement a class
In the first part of this lab, you need to implement a class that encapsulate a Grid. Grid
is a useful concept in creating board-game applications. Later we will use this class to
create a board game. A grid is a two dimensional matrix (see example) with the same
number of rows and columns. You can create a grid of size 8, for example, it’s an 8x8
grid. There are 64 cells in this grid. A cell in the grid can have any arbitraty value. Later
in this course, we will learn how to create a cell that can hold any arbirtary values.
However, for the time being, we will assume that the cell-values are non-negetive
integers. If a cell contains a value ‘0’ that means, the cell is empty. To identify a cell,
you need row number and column number, for example, cell (1, 3) means 3rd cell of the
1st row. You need to create a class that satisfies the following requirements.
Tasks
Write tests and code for each of the following requirements, in order. The words in
bold indicate message names. Whenever a requirement says the user can \"ask
whether...\", the expected answer is boolean. Whenever a requirement speaks of a
\"particular\" item, then that item will be an argument to the method.
1. The user can create a Grid specifying the number of row and column. Also the
user can create a Grid specifying the size only.
2. The user can ask a Grid whether its isEmpty. A grid is empty when all the cells
of the grid is empty.
3. The user can clear all the cells of the grid. It’s a void method.
4. The user can ask a Grid whether a particular cell isValid.
5. The user can ask a Grid to set a particular value by setValue to a particular row
and col. The grid sets the value only if that cell is valid.
6. The user can ask a Grid to getValue (in this case integer) from a particular row
and col. The grid returns the value only if the locations are valid.
7. The user can ask a Grid to set part of its row and column with particular values.
Example, setCells(int rows[], int cols[], int vals[]), in this method user can
specify the indexes of rows and columns that the user wants to set with some
particular values (supplied in vals array). Note that, rows, cols, and vals arrays
should be of same size.
8. Make another overridden method for setCells(int rows[], int cols[], int v), that
will set particular rows and cols of a grid with a particular value.
Apart from these basic requirements, feel free to add more behaviors to the Grid class
that you think appropriate. Please provide explanation for those behaviors as a
comment in the source file.
Note: A grid is composed of many cells. So, you may want to decompose the grid into
a Cell class that encapsulates all the necessary behaviour of a cell in the grid
I need these files from the above information:
o Cell.java
o Grid.java
o GridTest.java
Solution
Partner relationship management (PRM) is a business strategy for improving communication between companies and their channel partners. Web-based PRM software applications enable companies to customize and streamline administrative tasks by making shipping schedules and other real-time information available to all the partners over the Internet. Several CRM providers have incorporated PRM features, such as Web-enabled spreadsheePartner relationship management (PRM) is a business strategy for improving communication between companies and their channel partners. Web-based PRM software applications enable companies to customize and streamline administrative tasks by making shipping schedules and other real-time information available to all the partners over the Internet. Several CRM providers have incorporated PRM features, such as Web-enabled spreadsheets shared through an extranet, in their software applications. PRM is often compared to customer relationship management (CRM) and there is some argument over whether the complex relationships of channel partnerships makes it necessary for PRM to be a separate entity, or merely a component of CRM.ts shared through an extranet, in their software applications. PRM is often compared to customer relationship management (CRM) and there is some argument over whether the complex relationships of channel partnerships makes it necessary for PRM to be a separate entity, or merely a component of CRM.
