Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 ArrayListStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started