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
Problem 1 (Authentication): Consider the following authentication protocol, which uses a classical cryptosystem. Alice generates
Elis [28]

Answer:

Check the explanation

Explanation:

Yes, going by the question above, the protocol validates Bob to Alice for the reason that the key is only shared between Bob and Alice as well as the number which is being sent randomly. Therefore the invader won’t be able to predict and response to that number. Because of the authentication protocol, that makes use of a classical cryptosystem thereby resulting into the possibility of an argument such that key finding is attainable via invader.

5 0
3 years ago
Reconstructing a noise deformed analog signal is an impossible task.
beks73 [17]
False, (i'm not sure but I think that thats it)
7 0
3 years ago
What is astronaut favourite key on keyboard? ​
Dennis_Churaev [7]

Answer:

The space bar is an astronauts favorite key

5 0
2 years ago
Read 2 more answers
What's the best way to change the font size of all your notes pages at once?
pav-90 [236]

i think number 9 is c.

5 0
3 years ago
How many bits are necessary for a binary representation (unsigned) of
Musya8 [376]
A. 5
b. as an unsigned int: 9. Normally a year is 365.25 days which would require 32-bits for an IEEE float.
c. 25
3 0
3 years ago
Other questions:
  • Why is there more content on youtube in 4k then there is on cable, satellite, and digital tv combined?
    6·2 answers
  • At an open or uncontrolled intersection, yield if ____.
    15·2 answers
  • PLEASE ANSWER ASAP
    7·1 answer
  • What type of Internet monitoring technique records information about a customer during a web surfing session, such as what websi
    8·1 answer
  • Find the volume of the rectangular prism.<br>1<br>6 cm<br>32<br>cm​
    14·1 answer
  • How do you resolve conflicts in your life??
    11·1 answer
  • 2. Kabel yang digunakan pada jangan wireline, sebagai
    14·1 answer
  • The ________ is the easy way to insert a new slide between existing slides.
    8·1 answer
  • Mechanisms that can be used to rescue accident victims
    11·1 answer
  • Use the drop-down menus to describe the customize ribbon dialog box.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!