Activity 01
Pair Programming: Modular Calculator Build
Pairs outline calculator operations, write separate functions for add, subtract, multiply, and divide, then create a main loop for user input. Test with edge cases like division by zero. Pairs demo their calculators to the class.
Justify why modular programming is crucial for developing complex software applications.
Facilitation TipDuring Pair Programming: Modular Calculator Build, circulate and ask each pair to explain why they placed a specific operation in a function rather than in the main loop.
What to look forProvide students with a short, non-modular Python script (e.g., a simple text-based adventure game with repeated code blocks). Ask them to identify at least two sections of code that could be turned into functions and write down the proposed function names and their purpose.