1Z0-811 Control Flow and Loops Practice Question
A developer writes the following code: if (score >= 90) { grade = 'A'; } else if (score >= 80) { grade = 'B'; } else if (score >= 70) { grade = 'C'; } else { grade = 'D'; } What is the value of grade if score is 75?
⚠ Common exam trap
Oracle often tests the candidate's understanding that the else-if chain stops at the first true condition, so a score of 75 correctly falls into the 'C' range, not 'D' or 'B'.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
'C'
The code uses a cascading if-else-if structure that evaluates conditions from top to bottom. When score is 75, the first condition (score >= 90) is false, the second (score >= 80) is false, and the third (score >= 70) is true, so grade is assigned 'C'. The else block is only reached if all prior conditions are false.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
'B'
Why it's wrong here
score >= 80 is false for score 75.
- ✓
'C'
Why this is correct
score >= 70 is true, so grade is assigned 'C'.
- ✗
'D'
Why it's wrong here
The else block only runs if no condition is true, but here score >= 70 is true, so else is skipped.
- ✗
'A'
Why it's wrong here
score is 75, which is less than 90, so this condition is false.
Go deeper
Related to this question
About these practice questions
One of 481 original 1Z0-811 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.