Question: java Implement this method so that the calculation of the quiz grade drops the lowest N grades. This method should drop the lowest numberToDrop grades.

java

java Implement this method so that the calculation of the quiz grade

drops the lowest N grades. This method should drop the lowest numberToDrop

Implement this method so that the calculation of the quiz grade drops the lowest N grades. This method should drop the lowest numberToDrop grades. It should not be possible to drop more grades than the ArrayList contains. (You will need to ensure that the provided test case test_dropNGrades_DropTooMany () passes to ensure that your method's behaviour in this case is correct). This method should return a copy of the ArrayList gradeList, with the lowest (numberToDrop) grades removed. Hint: make a copy of the input ArrayList first, then determine whether you may drop any grades, then write a loop which iterates through the ArrayList to find the lowest grade and remove it which can then be run numberToDrop times. // TO-DO: write a method which returns a copy of the ArrayList passed in, with the lowest // numberToDrop grades removed. // It should not be possible to drop more grades than the ArrayList contains 1/ (if fewer grades are passed in than the number requested be dropped, then no grades should be removed) public ArrayList dropNGrades (ArrayList gradeList, int numberToDrop). { }

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!