Question: public class DataEntry { private int row, column; private double value; /** * inRange (10 marks) * * @param row1 * :int - The row

public class DataEntry {

private int row, column;

private double value;

/**

* inRange (10 marks)

*

* @param row1

* :int - The row index at the starting point

*

* @param column1

* :int - The column index at the starting point

*

* @param row2

* :int - The row index at the ending point

*

* @param column2

* :int - The column index at the ending point

*

* @return true if the DataEntry object is located between row1 and row2

* (inclusive) and between column1 and column2 (inclusive)

*

* return false otherwise

*

*/

public boolean inRange(int row1, int column1, int row2, int column2) {

// To be completed

return false;

}

////////////////////////////////////////////////////////////

//////////// ////////////

////// //////

/// Do not edit the below methods ///

///// //////

//////////// ////////////

////////////////////////////////////////////////////////////

/**

* assign values to instance variables using setters

*/

public DataEntry(int r, int c, double val) {

setRow(r);

setColumn(c);

value = val;

}

/**

* assign the higher of 0 and r to row

* @param r

*/

public void setRow(int r) {

row = Math.max(0, r);

}

/**

* assign the higher of 0 and c to column

* @param c

*/

public void setColumn(int c) {

column = Math.max(0, c);

}

public void setValue(double val) {

value = val;

}

public int getRow() {

return row;

}

public int getColumn() {

return column;

}

public double getValue() {

return value;

}

////////////////////////////////////////////////////////////

/// End of DataEntry.java ///

////////////////////////////////////////////////////////////

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!