solve problems and create computational representations of mathematical situations using coding concepts and skills
solve problems and create computational representations of mathematical situations by writing and executing code, including code that involves sequential events
Before students begin to write code (or build code using printed materials and templates), provide them with opportunities to act out or model situations, such as “move 5 steps forward” on “action cards”, using manipulatives or their own body. This will help them visualize what they intend to make happen on the screen.
Present students with a situation such as a turtle wanting to lay its eggs in the sand and needing to get to a specific location while avoiding obstacles. Have students work with a partner, using assigned roles – one of them can be the “programmer” and the other the “agent” (e.g., robot). Mark spots on the floor with removable tape, indicating the starting point for the turtle and the obstacles (e.g., tree, rock, water). Have the programmer provide a sequence of instructions for the turtle to move in a certain horizontal or vertical direction for a certain number of steps.
For a mathematical situation that involves addition of whole numbers, have students create code to move a digital image horizontally or vertically across the screen for the number of steps that are identified in the addition expression.
For example, have students model 9 + 4 by coding a digital image to move 9 steps to the right and then an additional 4 steps to the right. To support them in developing their estimation skills, ask them to predict where the digital image will stop before they execute the code. To further their thinking, ask them to explain what happens if the second instruction says to move to the left instead of the right.
read and alter existing code, including code that involves sequential events, and describe how changes to the code affect the outcomes
To support students in understanding the commutative property for addition, have them change the sequence of instructions in their code to model 4 + 9 instead of 9 + 4. Discuss why the digital image’s distance from the starting point remains the same in both cases.
When movement from one location to another involves moving in multiple directions, altering the sequence of instructions can change the result. For example, have students create code for the turtle to get to the pond. Then ask them to alter the sequence of instructions in their code and verify that the turtle can still get to the pond.