Control Structures Quiz
1. What is the main purpose of using a **Control Structure** in programming?
To control the flow or order in which code is executed.
To define variables and data types.
To write comments explaining the code.
To encrypt the source code for security.
2. Name the **three main categories** of Control Structures.
Variables, Constants, and Arrays.
Input, Processing, and Output.
Start, Stop, and Pause.
Loops, Branches, and Function/Procedure Calls.
3. Which type of control structure allows you to **automate repetitive tasks**?
Branches
Procedures
Loops
Arguments
4. Which specific loop type is used when you know the **exact number of times** the code needs to run?
FOR loop
REPEAT loop
DO-WHILE loop
JUMP loop
5. Which specific loop type continues running **as long as a condition remains true**?
FOR loop
WHILE loop
IF-THEN loop
REPEAT loop
6. What is the purpose of the **BREAK** keyword when used inside a loop?
To skip the current iteration and move to the next.
To pause the program for a moment.
To immediately stop or exit the loop.
To restart the loop from the beginning.
7. Which type of control structure allows a program to **make decisions** and execute different code blocks?
Functions
Procedures
Libraries
Branches
8. What is the fundamental structure used to check a single condition and run code only if it is true?
ELSE statement
IF statement
LOOP statement
CALL statement
9. In an **IF** statement structure, which keyword specifies the code block that runs **only if the condition is false**?
THEN
RETURN
ELSE
BREAK
10. What is the term used for the statement that checks a **second condition** if the first IF condition was false?
ELSEIF (or ELIF)
NEXTIF
AND statement
LOOP check
11. What are the two essential actions you must perform with a function: first to create it, and second to run it?
Inputting and Outputting
Defining and Calling
Testing and Debugging
Declaring and Returning
12. What is the specific keyword used in Python to **start defining** a function?
function
new_func
def
procedure
13. When defining a function, what is the term for the input data that the function needs to perform its work?
Arguments
Parameters
Variables
Operands
14. When you use a function's name in your code to execute its instructions, what is this action called?
Defining the function
Declaring the function
Importing the function
Calling the function
15. What is the primary difference between a **Function** and a **Procedure**?
Functions are always faster than Procedures.
Procedures are defined, but Functions are not.
Functions return a value; Procedures do not.
Procedures can only be used with loops.
16. If you want a function to produce an **output value** that you can store in a variable, must you use a Function or a Procedure?
Function
Procedure
An IF statement
A WHILE loop
17. What might happen to a program if a **WHILE** loop's condition is written incorrectly and **never becomes false**?
The program will skip the loop and continue.
It will run as an infinite loop and may crash the program.
The loop will automatically convert to a FOR loop.
The operating system will correct the condition.
18. The BTEC specification includes IF, THEN, and ELSEIF (ELIF) under which main category of control structure?
Loops
Function Calls
Procedures
Branches
19. When a function is running, and it is finished, what command allows it to **send a value back** to the main program?
OUTPUT
YIELD
RETURN
FINISH
20. Why is the use of control structures important for **improving the effectiveness of code**?
To select, apply, and interpret structures to analyze and improve the code.
To reduce the number of variables used in the program.
To convert all data into Boolean types.
To ensure the code can only run on Windows machines.
Submit Quiz