Activity 01
Pair Programming: Guessing Game Builder
Pairs design a while loop where the program picks a random number between 1 and 100; the player guesses until correct, with hints for high or low. Test multiple rounds and adjust for edge cases like invalid inputs. Discuss why a for loop would not fit.
Compare the appropriate use cases for 'for' loops versus 'while' loops.
Facilitation TipDuring Pair Programming: Guessing Game Builder, ask each pair to swap roles after every guess to keep both students engaged in logic and debugging.
What to look forProvide students with two code snippets: one using a 'for' loop to iterate through a list of names, and another using a 'while' loop to ask for a password until it's correct. Ask students to write one sentence explaining which loop is more appropriate for each task and why.