Coding has been introduced into the Grade 9 mathematics course as a continuum from the elementary mathematics curriculum. The elementary mathematics curriculum outlines a developmental progression for students to develop foundational coding skills. In Grade 9, students transition to using coding as a tool to interact with the mathematics they are learning. They use the skills developed in elementary to create and alter code in a multitude of coding environments including text-based programming languages, spreadsheets, computer algebra systems (CAS), and virtual graphing and geometry tools.

Note: Coding expectation codes will be in some of the titles of the activities. There could be other MTH1W curriculum links as well, they are just not listed...yet.

Coding in Spreadsheets

Creating a Budget

Click here for link to this presentation.

Budgets & Built-In Conditionals (C2.1)

Students can watch the slide show on the left and discuss as a class why budgets are important.

Have students create a budget in Google Sheets. The last slide in the presentation on the left includes a video on how to create budget in a spreadsheet AND how to create conditional statements using the built-in tools in Google Sheets. Click here to access video now.


Budgets & If-Then-Else Statements (C2.1)

In the example above we work with a budget that assumes that income, expenses, and savings are static. As students get older, however, this is most likely not the situation. On the right you will see a spreadsheet that has a fluid budget.

With this fluid budget, students can still use the built-in conditionals to highlight if their budget is balanced or not. In this example, however, I would like to show you how students can create an if-then-else statement and indicate in words whether they are balanced or not.

Watch the video below to see how this can be done.

Click here for own copy of this spreadsheet to work with.

Read & Alter Code...and more!

Introduction to Variables (C2.3)

In coding, we tend to use descriptive names rather than single letters to represent variables.

Here are the typical steps for using Variables in computer programming:

1 – Declare the variable: This means, we will create a variable and give the variable a name. In Scratch, we select Variables, Make a Variable to do this.

2 – Initialize the variable: This is when we give the variable an initial or β€œstarting” value.

3 – Use the variable: When we make use of the variable in our program, we are using the variable. The value might change throughout the program.

Adopted by TVO Coding in the Classrooms

Click here to access the Scratch program.

Challenge students to do the following:

  • Add a third number and add it to the sum.

  • Change the operation to multiplication.

Slope & Y-Intercept (C2.1, C2.2, C2.3)

On the left is Slope & Y-Intercept program. Click the green flag and follow the instructions. Here is the link to the program that can be given to students: https://scratch.mit.edu/projects/581975328

Once the students have tried it a couple of times, have them remix the program and try to do one or more of the following:

  • Reset the slope and y-intercept values to zero when green flag is clicked (prior to user input)

  • Create a loop so that process is repeated 3 times

  • Use an if-else block to not display the y-intercept if the user put in 0 (HINT: Look at using an operator block that can help with this)

Teachers, here is an example of a solution to the three challenges above.

Simple Square...to Start (C2.1, C2.3)

Have students open this program. Before they click the green flag, have them read the code and try to guess what is going to happen when they run the program.

After they run the program and see the square, you can challenge them with the following:

  • Can you make the side lengths smaller?

  • Can you change the shape to a triangle?

  • Can you now draw a hexagon? pentagon? rectangle?

Adopted by @LisaAnneFloyd

In the Addition Game, two variables called num1 and num2 are given random values between 0 and 10. The + operator variable is used to add these two variables together and this value is stored in a variable called sum. The user will see the values of the num1 and num2 variables displayed on the stage when they click the green flag and will be asked to enter the sum of the two numbers.

A conditional statement is then used to determine if the user is correct or incorrect. The conditional statement compares the sum of the two numbers to the user’s answer.

Have students open the program. Challenge them to alter the program for different operations and/or change the conditions, such as greater than, less than, greater than/equal to, and/or less than/equal to.

Adopted by TVO Coding in the Classrooms


Introduction to Conditional Statements

(C2.1, C2.3)

The Ontario Ministry of Education defines a conditional statement as:

β€œA type of coding instruction used to compare values and express and make decisions. A conditional statement tells a program to execute an action depending on whether a condition is true or false. It is often represented as an if-then or if-then-else statement.”

Comparing Unit Rates - Conditional Statements & Nested Events (C2.1, C2.3)

Have students click on the program on the right. They will see that the program is comparing the unit rates from two items and will tell you the best price.

Provide students with this link so that they can read and then remix the program.

Challenge students to add a third product to be compared with the other two.

Adopted by @LisaAnneFloyd


Infinity Pool - Using Geometry and Coding to Explore Limits and Infinity (C2.3)

This lesson was created by OAME.

This lesson introduces students to the concepts of limits and infinity through the lens of a practical geometry and measurement problem and through the use of coding and spreadsheets. Students will begin with a practical problem, then investigate, in a theoretical way, how increasing the number of sides of a regular polygon, while holding the perimeter fixed, influences the area of the polygon. They will create a pattern of polygon area calculations that tends to the largest area, a circle, by adding smaller and smaller increments. Patterns will be examined using tables of values and graphs, with an end goal of students understanding that the area will approach a limiting value. Students will then apply this new knowledge to the original practical problem.

Click here for list of connected learning expectations in this lesson.

Create a Program

Create a Clicker Game! (C2.1, C2.2)

This tutorial will walk students through creating & using:

  • Variables

  • If-Else Control Statements

  • Comparable Operations

  • Loops

  • Counter

Activities using VEXcode VR (block coding)

Basketball Drills (C2.2)

TLDSB MTH1W Coding - 1 basketball drills

Click here to make your own copy and modify if you would like.



EQAO Coding Sample Questions - Explained

Coding Questions in EQAO Sample Test

Getting Started - Q&A

Do I need to learn a coding language to address the three curriculum coding expectations?

No. Coding/programs are instructions created by humans to make something happen. This can be done on paper and digitally. Platforms could include ones that students are exposed to in elementary schools, such as Scratch, but it is not necessary. For example, for the Financial Literacy expectations, students could use spreadsheets (i.e., Google Sheets) and use formulas and/or mathematical operations to determine certain outputs (i.e., =sum(C1:C20)/20).

What coding 'platforms' will students have used in Grade 9?

Most students will have been exposed to block coding. Common platforms for block coding would be ScratchJR (primary/junior), Code.org, and Scratch. To see how these platforms were incorporated, please visit our Gr1-8: 2020 Math page.

What coding skills will students be exposed to in elementary grades?

To help visualize the progression of coding skills that students will be learning in elementary school, here is an infographic created by OAME.

More Resources

Hastings And Prince Edward District School Board - Coding Support Page

Click here to access the support programs that HPEDSB has created for MTH1W math course.

Expectations

C2.1 use coding to demonstrate an understanding of algebraic concepts including variables, parameters, equations, and inequalities

C2.2 create code by decomposing situations into computational steps in order to represent mathematical concepts and relationships, and to solve problems

C2.3 read code to predict its outcome, and alter code to adjust constraints, parameters, and outcomes to represent a similar or new mathematical situation