Code.org Computer Science Discoveries Practice Test

Access More Questions
Which term describes the common programming structure that implements conditional statements?
Correct Answer:
If-Statement
Explanation:
Conditional decisions in a program are handled by checking a condition and taking different actions depending on whether that condition is true. The common structure for this is the if-statement, which evaluates a condition and runs a block of code when the condition is true. It can also include an else part to run something when the condition is false, and sometimes else-if for additional checks. For example: if (temperature > 100) { alert('Too hot'); } An expression is any combination that yields a value, such as a comparison like x > 5. The result of that comparison is a Boolean—true or false—which can serve as the condition inside the if-statement. Abstraction is about simplifying complexity, not about the specific control flow used to make decisions. So the term that names this common programming structure for implementing conditional logic is the if-statement.

Access more questions from this quiz

Continue to Code.org Computer Science Discoveries Practice Test for more practice questions and the full quiz experience.

Access More Questions