Which of the following code segments correctly prints the names and scores of all the players who scored above high?

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.3: Declaring And Processing Two-dimensional Arrays
Problem 4E: (Practice) Write a C++ program that adds equivalent elements of the two-dimensional arrays named...
icon
Related questions
Question
100%
Explain to me step by step how to solve this problem and an step by step explanation on the output of each of the answer choices by showing me how the logic works. If you choose not to follow what I have laid out in my question you will receive a rating of not helpful.
1+
4
1:47
E
10. Consider two parallel arrays which contain the names and
corresponding scores of players in a trivia game.
(A) for (int element scores)
if (element > high)
String [names= {"Rob", "Pam", "Sandy", "Kelly", "Kim", "J.P.");
int [] 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?
(D) for (int i = 0; i < scores.length; i++)
if (scores [i]> 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]);
$
4
System.out.println (names[i]+""+ scores [i]);
(E) for (int i = 0; i <= scores.length; i++)
if (scores [i]> high)
R
System.out.println (names[i] +
FS
%
5
T
FO
6
Y
i
&
7
FB
U
LTE O
*
X
+ " " + scores [i]);
8
(
9
O
0
Transcribed Image Text:1+ 4 1:47 E 10. Consider two parallel arrays which contain the names and corresponding scores of players in a trivia game. (A) for (int element scores) if (element > high) String [names= {"Rob", "Pam", "Sandy", "Kelly", "Kim", "J.P."); int [] 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? (D) for (int i = 0; i < scores.length; i++) if (scores [i]> 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]); $ 4 System.out.println (names[i]+""+ scores [i]); (E) for (int i = 0; i <= scores.length; i++) if (scores [i]> high) R System.out.println (names[i] + FS % 5 T FO 6 Y i & 7 FB U LTE O * X + " " + scores [i]); 8 ( 9 O 0
Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
SQL Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr