Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Implement this method / * * Purpose: get the number of times a new highest score * in the list of competitors is found *
Implement this method
Purpose: get the number of times a new highest score
in the list of competitors is found
Parameters: List cList the list of competitors
Returns: int the number times a new highest score is
found when traversing from left to right
through the list of competitors
public static int numberTimesRecordBrokenList cList These are the tests public static void testNumberTimesRecordBroken
System.out.println
Testing numberTimesRecordBroken...";
Competitor c new CompetitorAli; new record
Competitor c new CompetitorSam;
Competitor c new CompetitorLee; new record
Competitor c new CompetitorJo; new record
Competitor c new CompetitorDani;
Competitor c new CompetitorZee;
Competitor c new CompetitorOla; new record
Competitor c new CompetitorMary;
Competitor c new CompetitorTheo;
Competitor c new CompetitorAli; new record
Competitor c new CompetitorTay;
Competitor c new CompetitorLuis;
Competitor arrc;
Competitor arrc c c c;
Competitor arrc c c c c c c c c c c c;
List list new ArrayListarr;
List list new ArrayListarr;
List list new ArrayListarr;
int result ;
int expected ;
result AExercises.numberTimesRecordBrokenlist;
expected ;
displayResultsresultexpected, "numberTimesRecordBrokenlist;
result AExercises.numberTimesRecordBrokenlist;
expected ;
displayResultsresultexpected, "numberTimesRecordBrokenlist;
result AExercises.numberTimesRecordBrokenlist;
expected ;
displayResultsresultexpected, "numberTimesRecordBrokenlist;
Step 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