Course Solutions Uncategorized (Solved) : Anyone Help Fix Code Param Row1 Param Column1 Param Row2 Param Column2 Return Average Valu Q26621650 . . . .

(Solved) : Anyone Help Fix Code Param Row1 Param Column1 Param Row2 Param Column2 Return Average Valu Q26621650 . . . .

 

Can anyone help me fix my code!!!

/**

*

* @param row1

* @param column1

* @param row2

* @param column2

* @return average of values of all DataEntry objects in givenaddress 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, intcolumn2) {

double sum = 0;

int count = 0;

for(DataEntry dataEntry : data)

{

if(dataEntry.inRange(row1, column1, row2, column2))

{

sum += dataEntry.getValue();

count++;

}

} return sum / count;

}

@Test @Graded(description=”Worksheet:average()”, marks=4)

public void testAverage() {

assertEquals(4.5/8,sheet.average(0, 0, 6, 6), 0.01);

assertEquals(2.6/6,sheet.average(0, 0, 5, 6), 0.01); //withoutthe 0 and 1.9

assertEquals(4.6/7,sheet.average(0, 0, 6, 4), 0.01); //withoutthe -0.1

assertEquals(-4.7/2,sheet.average(0, 3, 5, 3), 0.01); //4thcolumn only

assertEquals(0.4/2,sheet.average(4, 1, 4,

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : 18 Points 2 Extra Credit Points Entirely Corr Habet L W S W C W Ect Lower Case English Vow Q26162961 . . . .(Solved) : 18 Points 2 Extra Credit Points Entirely Corr Habet L W S W C W Ect Lower Case English Vow Q26162961 . . . .

<p dir="ltr"><img src="https://d2vlcm61l7u1fs.cloudfront.net/media%2F34f%2F34fd2033-f996-47dc-af50-e8a80982e7ac%2Fimage" alt="(18 points, 2 extra credit points if entirely corr habet), and L = w : #s(w)< #c(w)), where : ect) Σ-{a-:) (that is, Σ is the lower-case