- Activity:
- Create code that accomplishes something but uses breaks sloppily.
- Students then trace this code in groups.
- Discuss why break is a powerful but dangerous tool as a class.
- Next, students convert the messy break code to easier-to-follow code with for or while loops.
- Have students modify this code to add additional functionality.
- Lastly, discuss how hard it would have been to add this functionality to the original break code that was sloppy but still successful in completing a task.