Activity 01
Pair Programming: Countdown Challenge
Pairs write a 'for' loop to count down from 10 to 1, printing each number and a launch message at zero. They then convert it to a 'while' loop version. Partners alternate coding and testing, discussing differences in control.
Compare the appropriate use cases for 'for' loops versus 'while' loops.
Facilitation TipDuring the Pair Programming: Countdown Challenge, circulate to ensure partners take turns typing and discussing, reinforcing collaborative debugging and shared understanding of loop flow.
What to look forPresent students with two short code snippets, one using a 'for' loop and one using a 'while' loop, both performing a similar task. Ask them to write down which loop is more appropriate for each scenario and why.