I am working on the practice multiple choice problems for the AP Computer Science exam.
I came across this question:
4. At a certain high school students receive letter grades based on the following
scale.
Numeric Score Letter Grade
93 or above A
From 84 to 92 inclusive B
From 75 to 83 inclusive C
Below 75 F
Which of the following code segments will assign the correct string to grade
for a given integer score ?
I. if (score .5 93)
grade 5 "A";
if (score .5 84 && score ,5 92)
grade 5 "B";
if (score .5 75 && score ,5 83)
grade 5 "C";
if (score , 75)
grade 5 "F";
II. if (score .5 93)
grade 5 "A";
if (84 ,5 score ,5 92)
grade 5 "B";
if (75 ,5 score ,5 83)
grade 5 "C";
if (score , 75)
grade 5 "F";
III. if (score .5 93)
grade 5 "A";
else if (score .5 84)
grade 5 "B";
else if (score .5 75)
grade 5 "C";
else
grade 5 "F";
(a) II only
(b) III only
(c) I and II only
(d) I and III only
(e) I, II, and III
Letter D is the correct answer. My question is why is II wrong? Wouldn't that code execute fine or is there a problem with the if Statements?

