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
The ____ command will confirm the system directory that you are currently in
stira [4]
Im pretty sure the answer is PWD
7 0
3 years ago
for java ?(Business: check ISBN-13)ISBN-13 is a new standard for identifying books. It uses 13 digits d1d2d3d4d5d6d7d8d9d10d11d1
ludmilkaskok [199]

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String isbn;

 System.out.print("First 1:2 digits: ");

 isbn = input.nextLine();

 if(isbn.length()==12){

 int chksum = 0;

 for(int i = 0; i<12;i++){

     if((i+1)%2==0){      chksum+= 3 * Character.getNumericValue(isbn.charAt(i));          }

     else{          chksum+=Character.getNumericValue(isbn.charAt(i));          }  }

 chksum%=10;

 chksum=10-chksum;

 if(chksum==10){

 System.out.print("The ISBN-13 number is "+isbn+"0");}

 else{

 System.out.print("The ISBN-13 number is "+isbn+""+chksum);          }   }

 else{

     System.out.print("Invalid Input");

 }     }}

Explanation:

See attachment for explanation where comments are used to explain each line

Download txt
6 0
3 years ago
The this reference . a) can be used implicitly b) must be used implicitly c) must not be used implicitly d) must not be used 25)
Gnom [1K]

Answer:

yeet

Explanation:

because computers

6 0
3 years ago
Knowledge Spark, a school with no current job openings, wants to change to a completely virtual environment and offer classes to
Sedaia [141]

Answer:

AMONG

Explanation:

US

6 0
2 years ago
(true or false) fortnite is the best?
GarryVolchara [31]

Answer:

FALSE ZzZzZzZz

Explanation:

Cus it is PERIOT

7 0
2 years ago
Read 2 more answers
Other questions:
  • Write a for loop that iterates from 1 to numbersamples to double any element's value in datasamples that is less than minvalue.
    15·1 answer
  • 11. Describe an algorithm that interchanges the values of the variables x and y, using only assignments. What is the minimum num
    10·1 answer
  • Please help me with this question. I don’t get it
    11·2 answers
  • Should a waiting thread receive priority over a thread first attempting to enter a monitor? What priority scheme, if any, should
    9·1 answer
  • The building blocks of coded language are called
    11·2 answers
  • Which of the following candidates would most likely be hired as a graphic artist?
    15·2 answers
  • I'm getting pretty desperate plz help me, I'll give brainiest, and ill make a free question worth 100 points this is for coding
    10·1 answer
  • Brianna is feeling overwhelmed by the amount of digital
    13·1 answer
  • 56- What is the term used when you press and hold the left mouse key and more the mouse
    8·1 answer
  • Many large companies use the word(s), _____, to refer to the huge network of computers that meets their diverse computing needs.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!