Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

1. What is meant by Latitudes? 2. What is cartography ?

Answered: 1 week ago

Question

What is order of reaction? Explain with example?

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago