n the following code segment, assume that the double score has been properly declared and initialized. The code segment is intended to print the number of times score appears in array grades. double[
]
grades
={95.5,88.0,94.2,95.5,83.5,80.0,88.0,95.5,98.3}
; int count
=0;
for (int
i=0;i<=
grades. length;
i++)
{
if (grades
[i]==
score)
{
count++; \}
}
The code segment does not work as intended. Which of the following changes should be made so the code segment works correctly? The expression in the if statement should be changed to count
+=
count The condition in the if statement should be changed to grades
==
score The Boolean expression in the for loop header should be changed to
i<
grades.length The Boolean expression in the for loop header should be changed to
i<
grades.length
−1
The condition in the if statement should be changed to grades[i] = score