Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1askS Write tests and code for each of the following requirements, in order. The words i?n bold indicate message names. Whenever a requirement says the

image text in transcribedimage text in transcribed

1askS Write tests and code for each of the following requirements, in order. The words i?n 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 rowsll, int colsl/, int valsll), 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 vou think appropriate, Please provide explanation for those behaviors as a comment in the source file Write a test class to test the behaviours of the Grid class and submit the test class as well 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 behavior of a cell in the grid

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions