Grade 8 Matter and Energy
Lesson Summary: Students will create an interactive simulation that demonstrates the role of mass, volume, and density
in the behaviour of objects in fluids.
Curriculum Expectations: These expectations are intended to highlight the many ways in which this lesson could support
the curriculum. It is neither expected nor necessary for teachers to address all of these expectations at once. Teachers
are encouraged to select the most relevant expectations based on their unique context and intentions for the lesson.
Science & Technology
Mathematics
Language - Writing
Overall Expectations
A2. use coding in investigations and
to model concepts, and assess the
impact of coding and of emerging
technologies on everyday life and in
STEM-related fields
A3. demonstrate an understanding of
the practical applications of science
and technology, and of contributions
to science and technology from
people with diverse lived experiences
C2. demonstrate an understanding of
basic fluid mechanics, including the
properties and uses of fluids
Specific Expectations
A2.1 write and execute code in
investigations and when modelling
concepts, with a focus on automating
large systems in action
A2.2 identify and describe impacts of
coding and of emerging technologies,
such as artificial intelligence systems,
on everyday life, including skilled
trades
A3.3 analyse contributions to science
and technology from various
communities
C2.2 demonstrate an understanding
of the relationship between mass,
volume, and density
C2.5 determine the buoyancy of an
object, given its density, in a variety
of fluids
Overall Expectations
C3. solve problems and create
computational representations of
mathematical situations using coding
concepts and skills
Specific Expectations
C3.1 solve problems and create
computational representations of
mathematical situations by writing
and executing code including
code that involves the analysis of
data in order to inform and
communicate decisions
C3.2 read and alter existing code
involving the analysis of data in order
to inform and communicate
decisions, and describe how changes
to the code affect the outcomes and
the efficiency of the code
Overall Expectations
1. Generate, gather, and organize
ideas and information to write for an
intended purpose and audience
2. draft and revise their writing, using
a variety of informational, literary,
and graphic forms and stylistic
elements appropriate for the purpose
and audience;
Specific Expectations
1.1 identify the topic, purpose,
audience, and form for writing
1.2 generate ideas about a potential
topic, using a variety of strategies and
resources
1.3 gather information to support
ideas for writing in a variety of ways
and/or from a variety of sources
1.4 sort ideas and information for
their writing in a variety of ways
2.1 write short texts using a variety of
forms
2.3 use words and phrases that will
help convey their meaning as
specifically as possible
2.4 vary sentence structures and
maintain continuity by using joining
words (e.g., and, or) to combine
simple sentences and using words
that indicate time and sequence to
link sentences
3.4 use punctuation to help
communicate their intended meaning,
with a focus on the use of: quotation
marks to indicate direct speech;
commas to mark grammatical
boundaries within sentences; capital
letters and final punctuation to mark
the beginning and end of sentences
3.8 produce pieces of published work
to meet identified criteria based on
the expectations related to content,
organization, style, use of
conventions, and use of presentation
strategies
Breaking Down the Coding Expectations in Science & Technology:
In the Grade 8 Science & Technology curriculum, there are 2 coding related expectations:
A2.1 write and execute code in investigations and when modelling concepts, with a focus on automating large
systems in action
A2.2 identify and describe impacts of coding and of emerging technologies, such as artificial intelligence
systems, on everyday life, including skilled trades
To paraphrase these expectations and express them in plainer language, students are being asked to:
write code to demonstrate a science-related concept, focusing on writing code that includes elements of
automation
show how coding impacts our lives
Both expectations will be addressed through the project.
Learning Goals: We are learning to write code to create an interactive simulation that demonstrates the role of mass,
volume, and density in the behaviour of objects in fluids.
Success Criteria:
1. I can use conditionals to respond to data in my code
2. I can use sensing blocks to automate responses in my code
3. I can use variables to store and process data in my code
4. I can represent the role of and relationship between mass, volume, and density
STEM Profile:
Marion Ross is a pioneer in the world of fluid dynamics, which is the study of fluids. A Scottish physicist,
she paved the way for many in her field. During World War II, she worked for the British government to
explore underwater acoustics and hydrodynamics. In 1943, she received her PhD and later became the
first Director of the University's Fluid Dynamics Unit at the University of Edinburgh.
Like Marion, we will be exploring fluids so we can better understand how they behave. Let’s get started!
Minds On:
1. Students will have different experience levels when it comes to coding.
a) If students have never experienced coding before, please watch the “What is Coding?” video.
b) If students have experienced coding before, have a quick discussion in which students share their definition
of coding. Some responses to look for include:
i. Coding is the language that computers speak
ii. Coding is how we talk to computers or get computers to do what we want
iii. Coding is the instructions that we give to a computer
2. In small groups or as a whole class, brainstorm with students to generate ideas and key concepts that should be
represented in their simulation. Some sample prompts include:
o What is mass/density/volume?
o What is buoyancy?
o How does mass/density/volume affect buoyancy?
Planning Our Project:
Introduce the idea of a flowchart, a type of diagram that shows the sequence of steps involved in performing an
algorithm, with specific symbols used to represent different control structures. The symbols used in a flowchart are:
Oval - used to show the beginning and end of the program
Parallelogram - used to represent input or output
Rectangle - used to show processing (i.e., calculating or
manipulating data)
Diamond - used to show decisions (i.e., conditionals)
Lines and arrows - used to connect the shapes to show the
direction of the steps and to represent loops
Text and labels - included with shapes, as necessary.
Since every student’s project will be different, so will the flowcharts that they
create and the tools or technologies from which they can choose to create
their flowcharts (i.e., pen and paper, dedicated apps and websites for
creating flowcharts). A sample flowchart has been provided below to give a
general sense of what the end product may look like.
Creating Our Project:
The sample code demonstrate how the project might work and please note that the sprites representing the molecules
are exact duplicates, so the code is the same for each. For your reference, Scratch determines where to display sprites
and controls movement using a Cartesian coordinate system, with (0,0) being the center of the screen and it may be
helpful to pre-teach this concept, if it is one with which students are unfamiliar.
Part 1: Create the Container
1. Create a custom sprite using the Paint Editor to serve as the container. Using the rectangle tool, create a rectangle
or square with an outline weight of at least 10 that has a transparent fill.
2. To simulate the effect of a liquid, you may wish to use another rectangle shape to partially fill in the container,
ensuring that it is not covering the black outline of the original shape. If you choose this option, ensure that the
colour of the “liquid” is different than the colour of the outline for the “container”.
Part 2: Create the Mass, Volume, and Density Variables
1. Create 3 new variables in the orange Variables menu, named Mass, Volume, and Density.
2. Right click on each variable as it appears on the stage and change them all to a sliding variable.
3. Right click on each variable again to change the slider range.
a. Set Mass and Volume to a minimum of 1. The maximum value is recommended to start at 100, but this
can be altered, depending on what you are attempting to simulate.
b. Set Density to a minimum value of 1 and maximum of 5 if your Mass and Volume each have a range of 1
100.
Part 3: Create the Object
1. Add a sprite that will serve as the object to sink/float in the simulation. One recommendation is the pre-designed
Ball sprite already available in Scratch. You may also wish to use the Paint Editor to create your own object.
2. Add a When Green Flag Clicked block
3. Add a Go To X () Y () block and set the starting coordinates.
4. Add a Forever block. All of the following steps will be inside of this block.
Part 4: Sink Conditional
1. Add an If () Then conditional block and make sure that this block is inside of the Forever block from Part 3, Step 4.
a. Inside of the space to declare the condition, add a () > () block. Inside the first blank space of that block,
add a () / () block. There should now be 3 blank spaces to fill.
b. Add the Mass, Volume, and Density variable blocks to each of those 3 blank spaces, in this order.
c. The final statement for the condition should read as (Mass) / (Volume) > (Density).
2. Inside of the If () Then conditional block, add another If () Then conditional block (Nested-If).
a. Inside the space to declare the condition, add a Not () block
b. Inside the space for the Not () block, add a Touching Color ()? Block. It is very important that the exact
colour is correct; your eyes may not be able to tell subtle differences between colours, but your computer
can, so use the color dropper to select the exact shade used for the outline of the container sprite created
in Part 1.
3. Inside the second If () Then conditional block created in the previous step, add a Change Y by () block. Set the value
to -5. This will make it so that when the values for Mass, Density, and Volume should cause the object to sink, it will
only move down on the screen until it touches the outline of the container so that it does not “leak” outside the
container sprite.
Part 5: Float Conditional
1. Outside the two conditionals in Part 4 but still inside of the Forever block from Part 3, add another If () Then
conditional block.
a. Inside of the space to declare the condition, add a () < () block. Inside the first blank space of that block,
add a () / () block. There should now be 3 blank spaces to fill.
b. Add the Mass, Volume, and Density variable blocks to each of those 3 blank space, in this order.
c. The final statement for the condition should read as (Mass) / (Volume) < (Density).
2. Inside of the If () Then conditional block added in the previous step, add another If () Then conditional block (Nested-
If).
a. Inside the space to declare the condition, add a () < () block
b. Inside the first space for the () < () block, add the Y Position variable block. This will enable the conditional
to evaluate the current position of the sprite along the Y axis.
c. Inside the second space for the () < () block, write the Y coordinate at which point the object will have
reached the upper edge of the liquid you simulated in the container sprite. In the sample code provided,
this coordinate would be 0. Yours may differ depending on the size of your container sprite and where you
have positioned it on screen.
3. Inside the second If () Then conditional block created in the previous step, add a Change Y by () block. Set the value
to 5. This will make it so that when the values for Mass, Density, and Volume should cause the object to float, it will
only move up on the screen until it appears to reach the “surface” of the liquid
Extensions
Add another variable to alter the type of liquid being represented on screen. In this example, the liquid
represented is water, which has a density of 1 g/cm
3
. How will this affect the behaviour of the item and whether
it will sink or float?
Consider adding sound effects to the simulation using the pre-loaded sounds in Scratch or use the Sound Editor
to record their own sounds. The Start Sound () and Play Sound () Until Done blocks will allow students to insert
those files into their code.
To learn more about fluids and buoyancy, consider the following books and videos:
o Buoyancy: What Makes Something Float or Sink? From Kids Want to Know
o Science Max - Volume, Mass and Density - Full Episode from TVOkids
o Density - Why does oil float on water? From It’s AumSum Time
Sharing Our Work/Consolidation: Students can share Scratch projects using these steps.
1. Students should be provided with time to share their projects with others and to engage in self and peer
assessment. This can be done in a variety of different formats, including a gallery walk, whole class presentation, or
“trading” their project with another student. Students can provide feedback in a variety of ways, including written
and verbal. A variety of feedback options and templates are available in Appendix A.
2. An important aspect of assessing student understanding is focusing on the process, not the product. While it is
important to have a final product that functions as intended, students are often asked to produce something within
a limited time frame; therefore, it may be the case that, given more time, a student would be able to produce a
fully functional product.
To assess learning, teachers can conference with students throughout the creation of their projects using the
anecdotal prompts in Appendix B and documenting these discussions using an anecdotal observations chart.
Teachers are encouraged to consider the troubleshooting strategies used by students throughout the project, their
ability to explain how their project works, and what they might do differently in the future.
3. A rubric can be used to evaluate the final product. This and other assessment and evaluation tools can be modified,
as needed.
Low -Tech/No-Tech Modifications:
While it is ideal to have one device per student, this is not the reality for many classrooms. If you are planning to
have students work in groups, consider a maximum group size of 2 students to ensure as much “hands-on” time
with coding as possible. If access to devices is limited, you may wish to implement this lesson as part of a station
rotation within your classroom or use another strategy to work with small groups.
If you have no access to devices, you can:
o print images of the Scratch blocks in the folder at this link, cut them out and have students create their
code with paper blocks instead.
o You may also wish to print out images of the background scenes and characters to further support students
Appendix A: Self and Peer Feedback
Student Self Assessment
o Thumbs Up
o WIN
Peer Assessment
o Two Stars and a Wish
o TAG
Appendix B: Anecdotal Prompts
Throughout the time when students are creating their projects, teachers are encouraged to circulate and conference
with students to discuss their projects and progress. The process is just as, if not more, important than the final product
when it comes to coding, so this is key to truly understanding a student's understanding.
Key Concepts
Students should be able to identify, name, and explain key coding concepts in their own words; for example, sequence
can be described as “the order in which you write your code matters”. Conditionals can be described as “if-then
statements that give your computer options to choose from.” The wording may be unique to each student, but they
should be able to explain the concept.
Suggested Prompts:
1. Can you tell me what you know about ______?
2. Can you show me where in your code you used _____? How does it work?
Application
There may be times when students “stumble” into the “right” answer in their code without fully understanding how
they got there, while another student may have a project that isn’t working the way they intend, but they know exactly
why and are able to very clearly articulate the steps they would take to fix the issue, if they had more time. Just because
a student’s project is not working exactly as they want it does not necessarily mean that they don’t understand so it is
important to take the time to discuss with students.
Suggested Prompts:
1. Can you tell me what this section of your code does?
2. It seems like this section of code isn’t working the way you want it to. Why do you think that might be? How
might you fix it?
3. What would happen if you made _____ change?
Troubleshooting/Debugging
In the world of code, a lot of mistakes are going to be made. Not only is this completely normal (and it happens to
professional computer programmers all the time), but it is actually HOW we learn to code. To move from making the
mistake into learning from it, students need to develop and utilize effective troubleshooting strategies. If a student just
sits there staring at their code for a week trying to figure out an issue without ever asking for help, they are not
demonstrating effective troubleshooting strategies. Effective troubleshooting strategies that students may demonstrate
include:
Reading their code out loud to themselves to attempt to identify errors
Sharing their code with a peer to ask for help in identifying an error
Dealing with frustration by taking a break from their code
Searching the web for answers to their questions
Suggested Prompts:
1. Can you tell me about a time where your code wasn’t working the way you wanted it to? What did you do to
fix it?
2. It seems like this section of code isn’t working the way you want it to. Why do you think that might be? How
might you fix it?
3. What are some mistakes you made when creating your project? What would you do differently next time?