2. Revise the Csc20Grader class by implementing the two methods getArrayLowestSc
ID: 3723498 • Letter: 2
Question
2. Revise the Csc20Grader class by implementing the two methods getArrayLowestScorelndex and getAverage to calculate the average of the test scores with two lowest scores dropped. You are given a method called setAnArrayElementToZero which takes an array index position (type int) as input and set the array 's element at that position to zero. (10 points) public class Csc20Grader // The testScores field is a variable that will reference /I an array of test scores. private public Csc20Grader (doublet] scoreArray) double[] testScores; tes t scores scoreArray; = /I getArrayLowestScoreIndex method returns the lowest test // score's array Index. Test scores have values greater // than zero. public int getArrayLowestScoreIndex () 4 L CExplanation / Answer
public class Csc20Grader { private double[] testScores; public Csc20Grader(double[] testScores) { this.testScores = testScores; } public int getArrayLowestScoreIndex() { double min = testScores[0]; int minInd = 0; for(int i = 0; iRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.