C3.2 Read and alter existing code, including code that involves sequential, concurrent, repeating, and nested events, and describe how changes to the code affect the outcomes.
Activity 1: Nested Events (Counting in Fractional Intervals)
- Ask students to read the code below and explain their understanding of it.
![](/img/activite/algebre/en/4e/VE4_Algebre_Image137_en.png)
- Discuss with students the results of the code.
- Ask students the following questions:
- Why is there a loop inside another loop?
- Is it possible to change the code to count in half increments? in quarter increments? in sixth increments? What needs to be changed?
- Can you describe the impact of the changes on the outcome?
Activity 2: Repetitive and Interlocking Events (Link to Time)
- Ask students to read the code below and explain their understanding of it.
![](/img/activite/algebre/en/4e/VE4_Algebre_Image138_en.png)
- Ask students the following questions:
- What would be the impact on the outcome if the control block
were changed to
?
- Explains the impact of this change on the results.
- Is it possible to modify the code to represent months and a year? years and a decade? decades and a century?
- What would be the impact on the outcome if the control block