Activity 01
Pair Programming: Task Decomposition
Pairs get a complex task like a grade calculator. They list needed functions, write and test one at a time, passing parameters for inputs. Switch roles every 10 minutes and integrate at the end.
Explain how functions improve code readability and maintainability.
Facilitation TipDuring Pair Programming: Task Decomposition, circulate and ask each pair to label every repeated code block with a temporary comment before converting it to a function.
What to look forPresent students with a short, linear script (e.g., calculating area and perimeter of multiple rectangles). Ask them to identify repetitive code blocks and suggest how they could be turned into functions. Then, have them write the definition for one proposed function.