Unit 3 Lesson 2 Hacks
Unit 3.3-3.4 Hacks
Hack 1
Sequencing: A sequence is the order of the code/ the order the code will run in. In the example, steps 1-5 are the sequence, and, for example, it cannot move on to step 2 until the first step is completed, which is setting the item to the number.
Selection: Selection is the conditional part of the algorithm where it makes the next decision whether or not the condition is true. In the example, if the number selected is equal to the item, “item found” would be displayed.
Iteration: Finally, iteration is the step where the program loops until the condition is met. Therefore, in the image, iteration would be when the program checks to see if there are more numbers in the list, going back to step 2. Then, if the condition is not met, it displays “item not found.”
Hack 2
3 across - Sequence 1 down - Iteration 2 down - Selection