1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vfiekz [6]
3 years ago
12

The code below is supposed to display the name and score for the student with the highest score one time before the program ends

. It is displaying Jim as the student with the highest score. It is displaying the highest score of 95. Unfortunately, Jim does not have a score of 95. Correct the following code:
Declare String students[SIZES] = {"Jen", "Jon", "Jan", "Joe", "Jim"}
Declare Integer scores[SIZES] = 70, 85, 72, 95, 90
Declare Integer index Declare Integer highest = scores[0]
Declare Integer highest Name = " " For index = 0
To SIZES //Assume that this translates to For (index = 0; index <= SIZES, index ++)
If scores[index] > highest then highest = scores[index]
End Of highestName = students[index]
End For Display "

The name of the student with the highest score is ", highest Name Display "The highest score is ", highest
Computers and Technology
1 answer:
Alona [7]3 years ago
7 0

Answer:

Modify

<em>If scores[index] > highest then highest = scores[index] </em>

<em>End Of highest</em>

<em>Name = students[index] </em>

<em>End For Display</em>

to

<em>If scores[index] > highest then highest = scores[index] </em>

<em>Name = students[index] </em>

<em>End Of highest</em>

<em>End For Display </em>

<em />

Explanation:

In the code, you posted the code segment that gets the name of the student with the highest score is outside the if condition that determines the highest.

To make correction, we only need to bring this code segment into the loop.

<em>See Answer</em>

You might be interested in
List the six external parts or "peripherals" of a computer system and identify which are output and which are input devices/ Lis
vitfil [10]
Keyboard-Input
Mouse-Input
<u></u>Monitor-Output
Speakers-Output
Printer-Output
Hard Drive<span>-Output</span>
3 0
3 years ago
Selling someone else's art, writing, music, or recording for your sole benefit is a copyright violation.
KATRIN_1 [288]
True urcifjwjcjkwjsjgv
8 0
3 years ago
Read 2 more answers
In recent years, there has been an effort by companies to make computer chips:
MrRa [10]

Answer:

A

Explanation:

3 0
3 years ago
Read 2 more answers
friend wanted us to decode this message ----- .---- ----- ----- .---- ----- ----- .---- / ----- .---- .---- .---- ----- .---- .-
hodyreva [135]

Answer:

01001001?01110111?01100001?01111001?00100000?01101001?01101011?01100101?01101100?01100001?01111001?00100000?01110101?01101110?01100001?01101100?01100001?01111001?00101110

3 0
3 years ago
What term describes the order an arragement of files and folders on a computer
astra-53 [7]
I think the answer you are looking for is just simply Organization

7 0
3 years ago
Other questions:
  • What year did bill gates form traf-o-data?
    8·1 answer
  • Explain what the 35ppm specification means
    13·1 answer
  • Pseudocode is an improvement over the IPO chart because it lays out the a0 sequence of steps for a particular program.
    6·1 answer
  • Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, ma
    13·1 answer
  • A sense of scale tells us what about the objects in a picture?
    11·2 answers
  • Which search engine do you prefer? Why
    15·2 answers
  • A user logs into Active Directory on a workstation and the user home directory does not redirect to a network share on a file se
    15·1 answer
  • A reflexive pronoun is a pronoun
    6·1 answer
  • Create a new Java project/class called ChangeUp. Create an empty int array of size 6. Create a method called populateArray that
    11·1 answer
  • The choice of database does not have any impact on the relevancy of search results?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!