Programming Constructs (OCR GCSE Computer Science): Quizzes
📚Quizzes
Practise the questions
12 questions from this quiz
ShowHide
Practise the questions
12 questions from this quiz
What are the three basic programming constructs?
What are the three basic programming constructs?
Sequence, selection, iteration
What does sequence refer to in programming?
What does sequence refer to in programming?
Executing instructions in order written
Why is sequence considered the foundation for all other constructs?
Why is sequence considered the foundation for all other constructs?
It is used in every program
What does selection allow a program to do?
What does selection allow a program to do?
Choose paths based on a condition
Which statements are used for selection?
Which statements are used for selection?
if, elif, and else
In the age example, what condition determines if someone is an adult?
In the age example, what condition determines if someone is an adult?
age >= 18
What does iteration involve?
What does iteration involve?
Repeating a block of code multiple times
What are the two main types of loops in programming?
What are the two main types of loops in programming?
Count-controlled and condition-controlled
When should you use a count-controlled loop?
When should you use a count-controlled loop?
When you know how many times to repeat
In the example 'for i in range(5)', what values does i take?
In the example 'for i in range(5)', what values does i take?
0, 1, 2, 3, 4
When should you use a condition-controlled loop?
When should you use a condition-controlled loop?
When you don't know how many times to run
What is an infinite loop?
What is an infinite loop?
A loop that never stops
