Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribed

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

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

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions