Grade 6

C3.1 solve problems and create computational representations of mathematical situations by writing and executing efficient code, including code that involves conditional statements and other control structures
C3.2 read and alter existing code, including code that involves conditional statements and other control structures, and describe how changes to the code affect the outcomes and the efficiency of the code

Scroll down this page to see all activities available, or use the buttons below to quickly access specific activities.

The curriculum expectations for grade 5 and 6 are very similar. The only difference is that there is more emphasis on the efficiency of the code. We suggest that you visit the activities provided in Grade 5 and earlier to build the foundation of the coding concepts before digging into the efficiency of this type of coding.

READ & ALTER EXISTING CODE

Typically, in math class, a child's reaction to a wrong answer is to try to forget it as fast as possible. In coding, 'the programmer is encouraged to study the bug rather than forget the error.' ~Papert

Debugging

A great example of an activity to read and alter code is to debug the code. This means, whenever you have an error, you will need to figure out where things went wrong. Read the code, alter the code, and then execute!

Watch the video on the left to watch a brief video that describes what debugging is all about. Then try the two debugging activities below.

Conditional Statements Example

Have students run this program by clicking on the green flag and move their cursor up, down, left and right. They will see quickly what is going on when Scratchy the Cat touches the sky, trees, and ground.

Have them 'look inside' to read the code and see how it works.

Extension: Students can create a new background and change the code to reflect the new items that Scratchy would touch.

Access to this resource is for TLDSB staff & Students only. To purchase a copy, go to https://learnx.ca/onmath/

Bug Walking Activities (Introduction to Coding with Scratch)

On pages 7 - 19 in this digital book you will be looking at 4 activities created in Scratch that help students become familiar with Scratch and using the Pen tool to create squares. Students will be learning how to use sequence of events, repeat blocks, and then nested repeat blocks.

Inequalities (B2.1, C2.4, 3.1, 3.2)

On pages 96 - 111 in this digital book teachers are provided with great guided unplugged activities to dig into inequalities, including a worksheet 'About Inequalities' that can be provided to students in English or French. Teachers are then given notes on how students will move forward to code with inequalities like x > 100, x + 50 > 100, and 2x + 40 > 100, using Scratch.

Plotting __ + __ = 100 (C1.1, 1.2, 1.3, 3.1, 3.2)

Teachers may want to review notes on page 138 and unplugged activity on page 139 (p 140 in French) in this digital book. Then jump to page 144 to read the teaching notes on how you can facilitate this lessons using the pre-made Scratch activity provided on page 145 (p 146 in French).

Note: activity pages that can given to students are provided in both English and French!

Fixing a Plotting Issue (C1.1, 1.2, 1.3)

Teaching notes can be found on page 153 in this digital book. The activity provided on the following page will give students an opportunity to debug a given code and put in an appropriate condition to make it work properly.


Conditional Statements

If-Then Coding Game

If-statements, can be often referred to 'if-then' since the nature of the condition of the 'if' statement is that if the condition is true, then you need to do this. If it is not true (false), then you need to do this. For more details, please refer to Conditional Statements in our Glossary.

Each round has one programmer and the rest of the students are “computers.” Start with the teacher as the programmer until students understand how to play, then students take turns as the programmer. There are different ways to play that allow for varying levels of difficulty (chose based on the age of your group). Allow the students to get creative with this and try to trick each other.

Easy

If I do _____, then you do ______. For example, “if I hop on one foot, then you spin in a circle.” The computers follow the if-then statement and start and stop when the programmer starts and stops.

Moderate

If I do _____, then you do ______, else _______. An example would be “if I touch my nose, then you hop on your left foot, else hop on your right foot.” The programmer can make their statements increasingly difficult as the game continues.

Hard

For the hard level, students follow the moderate rules but eliminate students who incorrectly follow the commands or are the last to follow. If a student is eliminated they can become a “broken computer” and sit down.

Activity adapted from https://pinnguaq.com/learn/ice-hopping-conditional-statements

Watch the video on the right for more details.

This is a fun and easy way to understand the concepts of conditional statements without doing any formal coding yet.

Conditional Chain Game

This activity will show that everyone understands the concept of if-then statements and can apply them in a conversation. Have everyone sit in a circle - if possible.

The teacher begins with a sentence, for example, 'if I go out tonight, I'll get pizza for dinner'. The next person (potentially in circle) must use the previous sentence with an "if" to begin their own sentence. For example, 'If I get pizza tonight, I'll watch a movie'. Then the next person could say, 'If I watch a movie, I'll watch Spiderman'.

Everyone goes around adding to the story with if statements.


Adapted from https://pinnguaq.com/learn/ice-hopping-conditional-statements#Conclusion & https://www.teachingenglish.org.uk/article/conditional-chain-game

If-Statements (Control/Conditional Structure)

This unplugged Code.org activity is a great way to learn more about how "if" statements in programming works. There is a Minds On (Getting Started), Action, and Consolidation (Wrap Up) sections in this activity that is easy to follow that generates great coding conversations & learning.

Conditional Statements

Make a Scrolling Background in Scratch

Watch the tutorial on the right. By the end of the video you will be able to make a moving background, including the ability to add multiple scenes, worlds, and locations. While creating this scrolling background, the following skills will be covered:

  • Use of loops/nested events and conditional statements

  • Movement side-to-side: translation of sprites by changing x-values (E1.4)

  • Use of an operation block to use an inequality statement

  • How to use the (x,y) ordered pairs to put sprites in starting positions (E1.3)


Try it out!

Blank Scratch Page: https://scratch.mit.edu/projects/editor

Or

Remix this Page (click on green Remix button): https://scratch.mit.edu/projects/485684952/

Create a Jumping Game!


This great 5-step tutorial will show you how to easily create a jumping game. You can use any sprite or background that you want. While creating this game the following skills will be covered:

  • Use of loops/nested events and conditional statements

  • Movement side-to-side: translation of sprites by changing x-values (E1.4)

  • Movement up and down: translation of sprites by changing y-values (E1.4)

  • Introduce how to create a variable, called score and how to increase this value by one (counter)

  • How to use the (x,y) ordered pairs to put sprites in starting positions (E1.3)

Movement & Using IF Statements Activity

In Scratch, you can control the movement of a Sprite (character) by deciding that if someone were to press the LEFT ARROW key, the Sprite would move left. If someone were to press the RIGHT ARROW key, the Sprite would then move right.

In this activity, students will be guided on how to add the appropriate blocks for this Sprite, Tera, move left and right using IF blocks of code. Students will be required to create, read, analyze, and alter their code to make Tera move correctly.

Instructions are provided in the activity with a comment block. You can also access them here.

https://scratch.mit.edu/projects/479183978/

Create a Virtual Pet!

This fun 4-step tutorial will show you how you can create your own virtual pet in Scratch. When students are done creating their virtual pet, they will have used the following skills:

  • Animation (changing costume)

  • Add speech bubble

  • Use of the wait control block

  • Create loops/nested events with repeat and forever blocks

  • Start a program when an object (sprite) is clicked

  • Broadcast a message and start program when message received (event listener)

  • Use ordered pairs to control where objects start, move to, and end (E1.4)

  • Introduce variable, hunger, and change the value up and down based on conditions set

Create & Execute Efficient Coding

What is the same? What is different? What do you think happens?

You can provide unplugged opportunities for students to read and analyze code by grabbing a snippet of code and asking what is happening. A great example of this given above. This was created using Scratch.


Code.org does a fantastic job in this Frozen activity in helping students learn how to code and build up to efficient transformations to make snowflakes and circles. As students progress, it can get difficult - which is a great opportunity for students to stop, think, and try different scenarios to narrow down the right code to create the desired outcome.

Have students read and analyze the code for both balls in this activity. They will need to click on each ball on the right hand side to view code for each one. Have them pay attention to the differences and similarities in the code for each ball. Have them determine which one was more efficient, and how a count feature was used in a conditional statement.

Students are encouraged to create a third ball and create efficient coding steps to have it bounce like the other two balls. They can choose to play with height and wait times with this new ball.

Equivalent Coding - Divers

In mathematics, we have equivalent fractions, expressions, ratios, and so on. In coding, we also have equivalent coding. This would be where we have similar/different code, but the same output results.

For example, in this Scratch activity, Divers, students will see that when they click on either Diver 1 or Diver 2 at the top, the divers will slide in from the left and stop and then disappear. Both will move the same way. Students can then 'See inside' the program to see how each diver is programmed. They can determine how the coding is the same, different, and which one would be considered more efficient.

Twinkle Twinkle Little Star - Make More Efficient

Remix this program so that Twinkle Twinkle Little Star still plays, but the code is condensed. If you are successful, you created equivalent code that is more efficient.

To find out how you can add music code blocks to your future Scratch programs, click here. Note, this would need to be done every time you start a new Scratch program.

Connections: Other Curriculum Expectations + Coding

Below you will find activities created by educators in TLDSB and beyond. Curriculum aligned expectations will be noted in each activity and provided with more detail at the bottom of this page.

Coin Flip Coding Activity (C3.1, C3.2, D2.1, D2.2)

Students can press the spacebar as often as they would like to simulate the coin flipping process. Over time, they will see in the box 'percentProbabilityHeads' will be closer to the theoretical expectation of 50.

Students are encourage to read code and follow the process that it is taking to make this work. Dig into the mathematical concepts required to make this code work.

Extension: students can attempt to modify or create from 'scratch' a program that simulates a probability event (i.e., dice, rock-paper-scissors, magic 8 ball).

CoinFlip - Code.gif

Create Table of Values (C1.1, C1.2, C1.3)

Introduction to creating Table of Values in Scratch.

Watch this video to see how you and your students can easily create a Table of Values in Scratch.

Alter Table of Values Code

This video will demonstrate how to alter the code created in the Introduction video to reflect a change in a pattern that add/subtracts different values. You will also see how to change your initial value in the table of values.


Practice!

Click here to access this program in Scratch. Have students Remix this program to make their own copy. Students should read the comment box inside the program. They will practice altering the code to reflect the patterns given for a, b, and c.

More Practice!

When students feel comfortable with making a Table of Values in Scratch, refer to page 9 (Number Patterns - with Scratch) in the Understanding Math + Coding Puzzles book. Page 10 will give you the French version. This activity will help students connect with some Patterns & Relationships curriculum expectations.

Creating a Budget

Click here for link to this presentation.

Dig deeper into creating/altering budgets with the resources provided in this Google Drive folder. You will have the lesson and resources to help students learn how to alter a sample spreadsheet to meet their own plans. The will learn how to design budgets and make choices based on challenging situations, such as wants and needs. (F1.3)


OAME Activity

Patterns & Relationships

C1.1 identify and describe repeating, growing, and shrinking patterns, including patterns found in real-life contexts, and specify which growing patterns are linear

C1.2 create and translate repeating, growing, and shrinking patterns using various representations, including tables of values, graphs, and, for linear growing patterns, algebraic expressions and equations

C1.3 determine pattern rules and use them to extend patterns, make and justify predictions, and identify missing elements in repeating, growing, and shrinking patterns, and use algebraic representations of the pattern rules to solve for unknown values in linear growing patterns

Number

B1.1 read and represent whole numbers up to and including one million, using appropriate tools and strategies, and describe various ways they are used in everyday life

B1.3 compare and order integers, decimal numbers, and fractions, separately and in combination, in various contexts


Data

D2.1 use fractions, decimals, and percents to express the probability of events happening, represent this probability on a probability line, and use it to make predictions and informed decisions

D2.2 determine and compare the theoretical and experimental probabilities of two independent events happening

Spatial Sense

E1.4 describe and perform combinations of translations, reflections, and rotations up to 360° on a grid, and predict the results of these transformations

Financial Literacy

F1.2 identify different types of financial goals, including earning and saving goals, and outline some key steps in achieving them

F1.3 identify and describe various factors that may help or interfere with reaching financial goals

F1.5 describe trading, lending, borrowing, and donating as different ways to distribute financial and other resources among individuals and organizations