Give me an in depth step by step explanation on how to solve this problem including a step by step explanation on how the ogic works for each answer choice. 10. Consider two parallel arrays which contain the names and corresponding scores of players in a trivia game. String names "Rob", "Pam", "Sandy", "Kelly", "Kim", "J.P."}; int I scores = (2600, 2420, 1790, 2100, 3100, 3250); Which of the following code segments correctly prints the names and scores of all the players who scored above high?
Give me an in depth step by step explanation on how to solve this problem including a step by step explanation on how the ogic works for each answer choice.
10. Consider two parallel arrays which contain the names and corresponding scores of players in a trivia game.
String names "Rob", "Pam", "Sandy", "Kelly", "Kim", "J.P."}; int I scores = (2600, 2420, 1790, 2100, 3100, 3250);
Which of the following code segments correctly prints the names and scores of all the players who scored above high?
(A) for (int element scores) if (element> high) System.out.print In (names + " " + element);
(B) for (int element scores)
if (element >= high)
System.out.println(names" "+element); (C) for (int i = 0; i < scores.length; i++)
if (scores [i]> high) System.out.println(names [i] + " " + scores [i]);
(D) for (int i = 0; i < scores.length; i++) System.out.println (names [i]+"" + scores [i]);
if (scores [i] >= high)
if (scores [i] high)
(E) for (int i = 0; i <= scores.length; i++) System.out.println(names [1] +""Cores [i]);
Trending now
This is a popular solution!
Step by step
Solved in 3 steps