Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

here is the code, assuse all other mathods in this code are well-definded. publi

ID: 3603822 • Letter: H

Question

here is the code, assuse all other mathods in this code are well-definded.

public class Worksheet {

private ArrayList data;

// DataEntry object contains row in int,column in int and value in double

private String title;

/**

* create a new worksheet with given title

* @param title

*/

public Worksheet(String title) {

data = new ArrayList();

this.title = title;

}

/**

* @return a shallow copy of the data

*/

public ArrayList getData() {

return data;

}

/**

*

* @return title of the worksheet

*/

public String getTitle() {

return title;

}

public Double get(int row, int column) {

//this mathod is well defined

}

public int indexOf(int row, int column) {

//well defined,

//index of DataEntry object in list data with given row and column

//* return -1 if no such DataEntry object found

}public int count(int row1, int column1, int row2, int column2) {

// well defined,

//return number of DataEntry objects in given address range , 0 if none

//* ((row1, column1) to (row2, column2))

}

public int count(int row1, int column1, int row2, int column2) {

//return number of DataEntry objects in given address range , 0 if none

//* ((row1, column1) to (row2, column2))

}

public double total(int row1, int column1, int row2, int column2) {

/*@return sum of values of all DataEntry objects in given address range

* ((row1, column1) to (row2, column2))

* return 0 if there are no items in the given range

*/

}

public double average(int row1, int column1, int row2, int column2) {

/*@return average of values of all DataEntry objects in given address range

* ((row1, column1) to (row2, column2))

* return 0 if there are no items in the given range

*/

}

public Integer minRow() {

}

public Integer maxRow() {

}

/**

*

* @return value of the last/first column/raw for which there is a DataEntry object

* in the list data

* return null if there is no data

*/

public Integer minColumn() {

}

public Integer maxColumn() {

}

public ArrayList getDataByRow(int row) {

@return list of values of data items from given row

* return empty list if no items belong to the given row

*/

}

public ArrayList getDataByColumn(int column) {

@return list of values of data items from given column

* return empty list if no items belong to the given column

*/

}

public String toString() {

//how to define this method? s.t. looks like

}

}

A(e) B(1) C(2) D(3)... AC (28) 2.5 1 2 4.5 .5

Explanation / Answer

public class Worksheet {

private ArrayList data;

// DataEntry object contains row in int,column in int and value in double

private String title;

/**

* create a new worksheet with given title

* @param title

*/

public Worksheet(String title) {

data = new ArrayList();

this.title = title;

}

/**

* @return a shallow copy of the data

*/

public ArrayList getData() {

return data;

}

/**

*

* @return title of the worksheet

*/

public String getTitle() {

return title;

}

public Double get(int row, int column) {

//this mathod is well defined

}

public int indexOf(int row, int column) {

//well defined,

//index of DataEntry object in list data with given row and column

//* return -1 if no such DataEntry object found

}public int count(int row1, int column1, int row2, int column2) {

// well defined,

//return number of DataEntry objects in given address range , 0 if none

//* ((row1, column1) to (row2, column2))

}

public int count(int row1, int column1, int row2, int column2) {

//return number of DataEntry objects in given address range , 0 if none

//* ((row1, column1) to (row2, column2))

}

public double total(int row1, int column1, int row2, int column2) {

/*@return sum of values of all DataEntry objects in given address range

* ((row1, column1) to (row2, column2))

* return 0 if there are no items in the given range

*/

}

public double average(int row1, int column1, int row2, int column2) {

/*@return average of values of all DataEntry objects in given address range

* ((row1, column1) to (row2, column2))

* return 0 if there are no items in the given range

*/

}

public Integer minRow() {

}

public Integer maxRow() {

}

/**

*

* @return value of the last/first column/raw for which there is a DataEntry object

* in the list data

* return null if there is no data

*/

public Integer minColumn() {

}

public Integer maxColumn() {

}

public ArrayList getDataByRow(int row) {

@return list of values of data items from given row

* return empty list if no items belong to the given row

*/

}

public ArrayList getDataByColumn(int column) {

@return list of values of data items from given column

* return empty list if no items belong to the given column

*/