Coding in the Classroom | Coding and Plotting Points

This activity allows students to apply coding skills within the context of plotting points and the Cartesian Plane.
By: Lisa Anne Floyd and Steven Floyd

In this activity, students are directed to a completed Scratch program that plots points on a Cartesian Plane. Students will then attempt to complete seven challenges, by altering various components of the code.

The program that students will alter is located here: https://scratch.mit.edu/projects/492542764/editor/.
Here’s a shortened link if you’d like to have students type the link into their browser: bit.ly/plottingcoding

Teachers can encourage students to experiment with the coding and math concepts by altering components of the code, and seeing what happens with each change.  Students can then try out the seven challenges, which are listed in a comment in the link to the code. Additional hints, to provide support for students are listed below.

We have also shared a Teacher Guide as well as possible solutions. The possible solutions are in the form of a screen print, as well as video tutorials. Feel free to share the solution screen prints and/or the videos explaining the solutions with students!

Challenges:

1) Alter the code to plot 5 diamonds in quadrant 1. Hint: Change the defined count in the repeat.

2) Alter the code to plot 10 diamonds in quadrant 2. Hint: Change the defined count in the repeat AND the change xcoord by value to a negative integer.

3) Alter the code to plot 20 diamonds in quadrant 3. Note: You may have to reduce the amount ycoord changes by to ensure the diamonds fit on the stage.

4) Alter the code to plot 10 diamonds in quadrant 4.

5) Alter the code so that diamonds are plotted until the xcoord value reaches greater than 100. Hint: Replace the repeat block with a repeat until block and add a greater than conditional operator into the defined count of the repeat. *This requires a change in code blocks. See below for some tips.

6) Try altering the code so that the plotted diamonds make a steeper line in quadrant 1 and stop when the xcoord is greater than 50. Hint: Consider how much the ycoord changes by each time through the repeat.

7) Try altering the code so that 30 diamonds go across two quadrants.  Hint: Adjust the initial values of the xcoord and ycoord variables (set blocks) and switch back to a simple repeat block.

Tips for Challenge 5

Under Control , select the repeat until block.
Under Operators , select the greater than block.
Swap out the repeat block and replace it with the repeat until block.
The xcoord block is found under Variables.
The “repeat until” block, and the “greater than” comparison operator block will be useful for students.

Teacher Guide:

Possible Solutions have been provided below.

You might choose to provide the solutions to students so they may check their work, or keep them for your own reference.

According to the Ontario Ministry of Education Curriculum and Resources (2020) website Grades 1-8 Mathematics Curriculum Glossary, a defined count is: “the number of times instructions are repeated based on a predefined value or until a condition has been met”.

Curriculum Expectations Addressed in this exercise:

Spatial Sense – Location and Movement:
E1.4 describe and perform translations, reflections, and rotations on a Cartesian plane, and predict the results of these transformations

Algebra – Coding Skills
C3.2 read and alter existing code, including code that involves events influenced by a defined count and/or sub-program and other control structures, and describe how changes to the code affect the outcomes and the efficiency of the code

*Thank you to Gabriela Bowen of HWCDSB for feedback on this Student Challenge.*


Possible Solutions:

There is more than one solution to each challenge so the code and outputs may vary.  This is one of the reasons that coding is so interesting for students.

1) Alter the code to plot 5 diamonds in quadrant 1.  Hint: Change the defined count in the repeat.


2) Alter the code to plot 10 diamonds in quadrant 2. Hint: Change the defined count in the repeat AND the change xcoord by value to a negative integer.


3) Alter the code to plot 20 diamonds in quadrant 3. Note: You may have to reduce the amount ycoord changes by to ensure the diamonds fit on the stage.


4) Alter the code to plot 10 diamonds in quadrant 4.


5) Alter the code so that diamonds are plotted until the xcoord value reaches greater than 100.  Hint: Add a greater than conditional operator into the defined count of the repeat.

Students will need to access additional blocks in order to complete this challenge.
Under Control, they can select the repeat until block.
Under Operators, they can select the greater than block.
They can swap out the repeat block and replace it with the repeat until block.
A possible solution is shared below.
The xcoord block is found under Variables.

6) Try altering the code so that the plotted diamonds make a steeper line in quadrant 1 and stop when xcoord is greater than 50. Hint: Consider how much the ycoord changes by each time through the repeat.

7) Try altering the code so that 30 diamonds go across two quadrants. Hint: Adjust the initial values of the xcoord and ycoord variables (set blocks) and switch back to a simple repeat block.

Scroll to Top