Menu

[Solved] Need Method Fastestrunner2017 Print Times Name Belonging Runner Need Help Code Code Must S Q37286135

Need the method fastestrunner2017 to print the times and thename belonging to the runner and need help here is some code thecode must be similar in the way it is written because I am still aintro student and need to understand it

public static void main(String[] args) {
  
String runnersName [] = {“Emily”, “Simon”, “Paul”, “Aaron”, “Kate”,”Cindy”, “Ryan”, “James”, “Michael”, “Sara”, “Joseph”, “Juan”,”Brad”};
  
int runnersTime2017 [] = {357, 299, 432, 326, 275, 450, 265, 343,264, 308, 242, 377, 273};
  
int runnersTime2018 [] = {341, 307, 328, 283, 274, 359, 256, 323,269, 308, 249, 340, 238};
  
fastestRunner2017(runnersTime2017, runnersName);

}
  
public static int fastestRunner2017(int Array1[], StringNames[]){
  
int Smallest = Array1[0];
  
int secondSmallest = Smallest;

int thirdSmallest = secondSmallest;

for(int i=0;i   
if(Array1[i] < Smallest){
  
thirdSmallest = secondSmallest;
  
secondSmallest = Smallest;
  
Smallest = Array1[i];
}

else if(secondSmallest > Array1[i] && Array1[i] >Smallest){

secondSmallest = Array1[i];
}
else if (thirdSmallest > Array1[i] && Array1[i] >secondSmallest){
  
thirdSmallest = Array1[i];
}

}

System.out.println(thirdSmallest + ” ” + secondSmallest + ” ” +Smallest);

return Smallest;

Expert Answer


Answer to Need the method fastestrunner2017 to print the times and the name belonging to the runner and need help here is some cod… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *