1.
What is the definition of Sequence?
Correct Answer
A. Lines of code that are run/executed in order
Explanation
The definition of sequence in programming refers to lines of code that are executed in a specific order. This means that each line of code is run one after the other, following a sequential pattern. The execution of the code occurs in a linear manner, without any branching or repetition. Therefore, the correct answer is "Lines of code that are run/executed in order."
2.
What is the definition of Iteration?
Correct Answer
D. Code that is repeated
Explanation
The definition of iteration is code that is repeated. In programming, iteration refers to the process of repeating a certain block of code multiple times. This is achieved using loops, which allow the code to be executed repeatedly until a specific condition is met. Iteration is a fundamental concept in programming as it enables the automation of repetitive tasks and helps in solving complex problems efficiently. By repeating a block of code, programmers can perform calculations, manipulate data, and execute instructions multiple times, making the code more efficient and effective.
3.
What is the definition of Selection?
Correct Answer
C. A check that chooses what code to run based on the outcome of an event
Explanation
The definition of Selection is a check that chooses what code to run based on the outcome of an event. This means that selection statements are used to make decisions in a program, where different blocks of code are executed based on certain conditions or events. These conditions or events are evaluated, and based on the result, the program decides which code block to execute.
4.
Which flow control does this code use? (You can select multiple types)
Correct Answer
C. Iteration
Explanation
The given code uses iteration flow control. Iteration is a type of flow control that allows a set of statements to be repeated multiple times based on a specific condition. It is often achieved using loops, such as for loops or while loops, which repeatedly execute a block of code until the condition becomes false. In this case, the code likely contains a loop that is being used to repeat certain actions or operations.
5.
Which flow control does this code use? (You can select multiple types)
Correct Answer(s)
A. Sequence
B. Selection
Explanation
The code uses sequence and selection flow control. Sequence refers to the order in which the statements are executed, one after the other. Selection refers to using conditional statements (such as if-else) to choose between different paths of execution based on certain conditions.
6.
Which flow control does this code use? (You can select multiple types)
Correct Answer
A. Sequence
Explanation
The code uses sequence flow control. Sequence flow control refers to the execution of statements in a specific order, one after the other. In this case, the code follows a sequential order, executing each statement in the order they appear.
7.
Which flow control does this code use? (You can select multiple types)
Correct Answer(s)
A. Sequence
B. Selection
C. Iteration
Explanation
The code uses sequence, selection, and iteration flow control. Sequence refers to the order in which the code is executed, with each statement being executed one after the other. Selection is used to make decisions based on certain conditions, allowing the code to choose between different paths. Iteration involves repeating a block of code multiple times until a certain condition is met.
8.
Which flow control does this code use? (You can select multiple types)
Correct Answer(s)
A. Sequence
C. Iteration
Explanation
This code uses both sequence and iteration flow control. Sequence flow control means that the code is executed in a specific order, one statement after another. Iteration flow control means that a certain block of code is repeated multiple times until a specified condition is met. In this case, the code is executed in a sequence, but there is also an iteration happening where a block of code is repeated multiple times.
9.
Which flow control does this code use? (You can select multiple types)
Correct Answer
B. Selection
Explanation
The code uses selection flow control. This means that the code has conditional statements that allow it to make decisions based on certain conditions. It selects a specific path of execution based on the outcome of these conditions.
10.
Which flow control does this code use? (You can select multiple types)
Correct Answer(s)
B. Selection
C. Iteration
Explanation
The given code uses selection and iteration flow control. Selection flow control is used when the code makes a decision based on a condition, such as using if statements or switch cases. Iteration flow control is used when the code repeats a set of instructions multiple times, such as using for loops, while loops, or do-while loops.