Professional Documents
Culture Documents
Grade 4
Unit 1
The World of Computing
Overview
In this unit, students will learn the main computer parts and how they interact with each
other. Students will be introduced to Scratch and they will code their first projects involving
events, broadcast, and storytelling.
Students will practice debugging and writing test cases. They will also explore and practice
testing and debugging someone else’s program.
Students will gain an understanding of searching algorithms used by software and how they
compare to each other. Through an experiential exercise, they will identify which algorithm is
fastest.
Finally, students will gain an awareness of how computing technologies are changing our
world and how devices have changed the way we engage in a multitude of behaviors.
Students will practice brainstorming and expressing ideas of how devices can impact and
improve human lives.
Outline Preparation
Lesson 1.1: How Does a Computer Work For all lesson plans, a classroom must
Lesson 1.2: Getting Started with Scratch include:
Lesson 1.3: Your Wish Is My Command ❖ Computers connected to the internet to
Lesson 1.4: Testing and Debugging access scratch.mit.edu
Lesson 1.5: Searching Algorithms ❖ Projector and speakers for lesson
Lesson 1.6: Computing Technologies and the demonstration and videos
World ❖ Student reflection/design journal
Lesson 1.7: Assessment Exercises
Glossary
BIOS- Basic input/output system: The BIOS is software stored on a small memory chip. It
loads the operating system and interfaces the hardware components with the operating
system.
Binary search - A search algorithm that checks the middle item in a sorted set to identify
which half the search key is in. The process is repeated until the item is found.
Broadcast - A message that is sent from one party for anybody to listen to. You can decide to
hear it (passive) or to listen to it (active). Scratch uses the broadcast construct so that one
sprite can communicate with the other sprites.
CPU - Central Processing Unit - (The brain of the computer) The CPU reads and processes
instructions and sends signals to control other parts of the computer.
Debug - Find and remove problems in computer programs.
Electronic nose - A device intended to detect odors and through processing interpret
meaning of what the smell is or points towards.
Event - An event is an action that causes something to happen. Computers continually check
for actions that are events.
Hashing search - A search algorithm where the search key is manipulated to indicate exactly
where to find the information.
Linear search - A search algorithm that involves going through every item in a set one by one
until the item is found.
Memory - The storage space in the computer where data to be processed and the
instructions are stored.
Peripherals - A peripheral device is generally defined as any helper device such as a computer
mouse or keyboard that connects to and works with the computer in some way. Other
examples of peripherals are image scanners, tape drives, microphones, loudspeakers,
webcams, and digital cameras.
Program (Computer) - A list of instructions that tells the computer to perform a task and is
written in programming languages like Java, C++, and Python.
Test Case - A set of conditions under which a tester will determine whether a program being
tested satisfies requirements or works correctly.
Alignment to Standards
CS K-12 Framework
Shorthand Concept Subconcept
Practices
Identifier Practice Statement
P6.Testing and Refining Testing and Refining Identify and fix errors using a
Computational Artifacts.2 Computational Artifacts systematic process.
Objectives Agenda
Explain that we are going to learn how computers work by studying different
components and concepts with weird names such as peripherals, BIOS, CPU, programs, and
memory.
Peripherals
Think of peripherals as the stuff around the main computer. Sometimes peripherals are built
into the computer itself like the camera and microphone on a laptop or tablet.
They are divided into Input Devices and Output devices. Input devices take in data from
outside the computer. Output devices convert information from the computer into physical
output.
What are some examples of input devices? Microphones, keyboards, smartphone screens.
And output devices? Printers, monitors, smartphone screens.
The BIOS provides a way for the computer to interact with its
environment. It controls what and how much information comes in
and out. When something urgent needs attention, it interrupts the
CPU.
Think of the CPU as the brain of the computer. The CPU runs the
show: it fetches and runs programs, it stores data, it deals with input
and output devices, it changes data in memory.
When you run a Scratch project, the CPU runs your scripts.
Programs
Memory
Credits: Images from Ted Ed video “Inside Your Computer”, Lesson by Bettina Bair, animation by Flaming Medusa
Studios.
Engage students in the following quiz as an interactive class exercise. (Answers are at
the end to allow the quiz to be projected for the class to see).
6. Why are programs saved in a different format than the human readable programming
languages that they are written in?
Answers:
2. Student Journals
Introduce students to the idea of the design journal, a physical or digital notebook
where they can brainstorm ideas and share personal reflections, similar to a personal
journal or diary.
Explain that students will be prompted to update their design journals throughout their
Computer Science adventure, and encourage them to add to their journals anytime during the
process of learning about Computer Science. The design journal is a good place to capture
ideas, inspiration, notes, sketches, questions, frustrations, triumphs, etc.
Check ✔ the correct column to indicate if the device is an input or output device
Hint: some rows may have 2 check marks.
Objectives Agenda
Preparation
Resources & Links
❏ Create a Scratch teacher account.
See appendix A for instructions. ❏ Scratch Teacher Account :
❏ View the Scratch teacher account https://tinyurl.com/yb4elakb
video.
❏ Scratch overview video:
❏ Create a Scratch class for your
https://tinyurl.com/m7ab2zp
students and optionally studios for
your students’ projects. ❏ Scratch backpack:
❏ Computers connected to the https://en.scratch-wiki.info/wiki/
internet Backpack
❏ Tell students to bring a journal (it
can be a notebook) to class
This section is only necessary if any of your students have not used Scratch before.
Even if they have, it might be a good review.
Scratch is a programming language. You can program your own projects, share your projects
and get help from others by using other people’s code.
https://tinyurl.com/m7ab2zp
It could be helpful to give a quick overview of how to code a couple of instructions to make the
cat move back and forth or as shown below make the cat move in a circle by clicking on the top
block of the script multiple times.
You may want to give a quick tour of the different sections of the Scratch tool such as:
Tell your students what their usernames are or to choose one if they are not pre-assigned. It is
recommended that students write down their Scratch username in their design journal.
Show students how to sign into Scratch and how you want to manage their projects.
4. Remix a Project
Explain to students what it means to remix a project. Since students will be remixing starter
projects during the student activities, focus the demonstration on how to remix a project when
given a project number.
The alternate way to remix a project is while exploring existing projects in Scratch. Once a
project of interest has been found, you click on the project, then click on the green remix
button and save it with a new name.
Point out the url in the browser specifically the project number shown in the red box
(your number will be different).
3. Replace the project number between the slashes with 365519987. Make sure that the
forward slashes (/) remain in place. If you double click on the project number, it is
selected and you can delete the previous one first. It is easy to make a mistake when
typing in a new project number.
4. If the editor is not already open, click on “See inside” in the upper right corner
4. Start working or exploring the new project or you can go back to the project page.
Tell students when they are working on a project to save it frequently. Remind
them also to save a remixed project and give it a meaningful name immediately
after remixing it. You may have to remind them to do this throughout the year.
In this activity, students will create a story in Scratch by remixing a project, writing a
dialog and then coding the dialog in their project. Distribute the student activity and
explain the activity to them.
Explore changing backdrops and adding
another character.
A Scratch Teacher Account provides teachers and other educators with additional features to
manage student participation on Scratch, including the ability to create student accounts,
organize student projects into studios, and monitor student comments.
It takes up to 24 hours to get your teacher account approved. Once you have the account and
log in, you will see the purple banner with with the features only available to teacher accounts.
This video tells you just about everything you need to know about teacher accounts and how to
create classes and add students:
https://tinyurl.com/yb4elakb
Once you have your teacher account, you can create a Class as demonstrated in the video.
After you add your students to your class, you will be able to see all the activities of your
students, including when students:
Once you have a Class created, you can also create a class Studio. Your students will be
automatically added as curators of the studio.
Studios can be used for a number of different reasons. It is a place where you can store a
collection of projects. For example, it can be used as a general space for your students to add
their completed projects, for a specific assignment, based around a particular theme, or even
used as a place to collect projects you are inspired by (among so many other possibilities).
Create studio with example projects, remixed projects (all projects that will be remixed by
students)
Objectives Agenda
❏ Starter Project:
https://scratch.mit.edu/projects/2
96217899/editor/
1. Broadcasting
In this section you will review the concept of an event and introduce the concept of
broadcasting to students.
Open the following project in Scratch to help with the discussion and demonstration.
https://scratch.mit.edu/projects/284713454/editor/
Display your screen and engage students in an interactive demonstration and instruction.
Select the Abby Sprite to show Abby’s script and prompt a volunteer to read the code. Then
ask students to describe what programming concept is used in the code shown.
Answer: The programming concept is an event. An event is an action that causes something
to happen.
Prompt students to name the action and the “something” that happens. (action: click on Abby;
the “something”: say “Everybody Move!”)
When we click on Abby on the stage, we want the cat and dog sprites to move. Do they move?
No. How can we do that? How does one sprite let the other sprites know it’s time to do
something?
In the media, when a program is broadcasted (on the radio, or TV, social media), it is sent from
one party for anybody to listen to. You can decide to hear it (passive) or to listen to it (active)
An example of a broadcast message in our daily lives could be a performer shouting to a crowd:
“Hello everybody!” . You can choose to say hello back or simply go on with what you were
doing.
In Scratch, sprites also communicate with each other using a broadcast message.
Demo adding the broadcast message:
Next, if a Sprite wants to listen to the message it adds a When I receive <message> event. For
the Cat sprite, we add the following block to the script:
Students will add the code for the dog in the next activity.
Remind students to be sure the message sent and listened to are the same.
Student Activity:
Instruct students to remix the following project and add the code to the dog sprite so it
also moves when we click on Abby.
Project: 326153011
In this activity students will work in pairs to code a project to practice using events and
broadcast messages.
Students are encouraged to work as a team with a partner, called pair programming. If
students are already familiar with the concept of pair programming, you may choose to skip the
next section. A review, however, could be beneficial.
Tell students they will be coding a project with a partner using events.
Pair Programming
When working on just about any project it is very helpful to have a partner to share
ideas, ask questions, help figure out a problem together or help each other when one
is stuck or does not understand something.
In many software companies like Google, Apple, Facebook and many more, computer scientists
use pair programming and team programming where several programmers work together on a
project. It would not even be possible to get most projects done without working in a team.
Let’s watch this video to learn how pair programming works: https://tinyurl.com/kuwoond
When working as a pair, only one student logs into their account. If both students
want to have the project in their Scratch account, tell students to share the project
when they are done and immediately have the other student remix it into their own
account.
Activity Description:
The project consists of giving a robot commands by clicking on various buttons that tell the
robot what to do. Students are provided with a starter project that includes 3 buttons. A
sample project is provided for you to demonstrate what the project is about.
Explain to students what they will be doing. Demo the sample project by running it and clicking
on the various buttons:
https://scratch.mit.edu/projects/296093588/editor/
If they finish coding the 3 buttons, tell students to add their own button with a new command.
Note: You may choose to demonstrate how to add text, change the color and move the
text inside a button sprite if students have not done this before.
Remind students to share their project so partners whose account was not used can remix it
into their account. Tell students to save their project and sign out of Scratch!
Reflection Points:
Student Activity Worksheet: Your Wish Is My Command!
What to do: Using/Details:
The B
utton2 sprite sends a Jump broadcast
message.
When the Robot sprite receives the “Jump”
broadcast message:
the robot moves up (change y by 60)
waits 0.4 seconds (so you can see it move)
moves back down
Add another button with a new command and write the scripts to do something new when
the button is clicked.
You can duplicate one of the other Button sprites
and then change the command under the
Costumes tab.
Follow the directions to the right to change the
text of your new button.
Objectives Agenda
Preparation
Resources & Links
❏ Projector and speakers for
demonstration ❏ Solution to Peter’s joke project:
❏ Become familiar with the https://scratch.mit.edu/projects/2
demonstration, the remix debug 1 96241615/editor/
and 2 projects.
❏ Student activity worksheet printouts ❏ Peter’s project with bugs:
one per student pair https://scratch.mit.edu/projects/2
96246955/editor/
1. Debugging
It is very common for programs and code not to work the first time you try it.
When there is a problem in the code, programmers refer to it as a bug. Can
someone tell me why they are called bugs?
Program errors are called bugs because many years ago a very large computer called the Mark
II malfunctioned because they found a moth stuck inside the computer. Since then
programmers use the term debugging to remove bugs from programs.
Testing a program means running the program to check if there are any bugs in it.
Programmers spend a great deal of time testing and debugging code. That is why it is
important to develop good debugging strategies.
Tell students:
Peter wrote a project in which Avery tells Devin a joke. Devin is listening and then
answers the question. When the joke is finished he starts laughing.
Open the following Scratch project and run it in full screen so students cannot see the scripts:
(click on )
https://scratch.mit.edu/projects/296246955/editor/
Hmmmm…. The project is not quite working as described. Peter must have made a couple of
mistakes. What is not working? Prompt students to call out what is actually happening that is
not as described.
Answer: 1) Peter talks at the same time as Avery instead of waiting for the question
2) He does not laugh at the end.
Student Activity:
In this activity students will fix Peter’s project. You may choose to do this as a class
activity or assign it as a student activity. Instructions:
Bug 1:
Devin does not wait long enough to talk, so he talks over Avery.
Avery first talks for 2 seconds, so Devin should wait 2 seconds, not 1.
Show the code for both and change Devin’s wait time to 2 seconds.
Test the code by running it again.
Bug 2:
Student Activity:
In this next activity, you have been given the task to test a new program. Your job is to read
how the program is supposed to work. Then you will test the program and write down in your
journal all the bugs you find.
Distribute the activity worksheet. Students may work in pairs or on their own.
After the activity, prompt students for the bugs they found.
Instruct students what to do. Follow-up the activity by reviewing the fixes to the bugs in the
program. There were a total of 3 bugs.
Solution:
Bug 1:
After Bella sings, she does not leave the stage. A hide
command is missing
Fix: Add a hide command at the end of the script.
Bug 2:
Fix: After singing, the Bella sprite should broadcast the “Done”
message.
Bug 3:
When the Contestant 3 button is clicked, contestant 1, Diego, shows up again to dance.
The problem is that when the button is clicked, it broadcasts the message “Contestant1”.
This is the wrong contestant.
Fix: Change the broadcast message to “Contestant3” for the button sprite with the label
“Contestant 3”.
Reflection Points:
What to do:
296498608
❏ Test the program and write down each bug you find in your design journal.
Objectives Agenda
1. Introduction
Engage students in a brief introduction to searching algorithms:
There are different ways for a program to search for information. Today, we are going to
discover different algorithms to search for something and we will discover that some are better
than others.
What does it mean for one algorithm to be better than another in computer programming?
A better algorithm is one that requires fewer steps because then the computer has to do fewer
operations. When a computer has to do fewer operations it means the program will run faster
and use fewer resources.
Today, we are going to experience using different searching algorithms and discover which ones
require fewer steps.
2. Linear Search
1. Organise yourselves into pairs. One of you has sheet 1A, the other sheet 1B. Don’t show
your sheet to your partner!
2. Both of you circle one battleship on the top line of your game sheet and tell your
partner
its number.
3. Now take turns to guess where your partner’s ship is. (You say the letter name of a ship
and your partner tells you the number of the ship at that letter.)
4. How many tries does it take to locate your partner’s ship? This is your score for the
game.
Note: Sheets 1A' and 1B' are extras provided for children who would like to play more
games or who “inadvertently” see their partner’s sheet. Sheets 2A', 2B' and 3A', 3B' are
for the later games.
Discussion Points:
3. Binary Search
1. Organise yourselves into pairs. One of you has sheet 2A, the other sheet 2B. Don’t
show your sheet to your partner!
2. Your ships and your partner’s ships are sorted in ascending order.
3. Both of you circle one battleship on the top line of your game sheet and tell your
partner its number. This is the number of the battle ship your partner must find. The
number that your partner gives you is the number of his battle ship you must find.
4. Now take turns to guess where your partner’s ship is. (You say the letter name of a
ship and your partner tells you the number of the ship at that letter.)
5. How many guesses does it take to locate your partner’s ship? This is your score for
the Game.
Discussion Points:
4. Hashing Search
1. Each take a sheet 3A and 3B as in the previous games and tell your partner the number
of your chosen ship.
2. In this game you can find out which column (0 to 9) the ship is in. You simply add
together the digits of the ship’s number. The last digit of the sum is the column the ship
is in. For example, to locate a ship numbered 2345, add the digits 2+3+4+5, giving 14.
The last digit of the sum is 4, so that ship must be in column 4. Once you know the
column you need to guess which of the ships in that column is the desired one. This
technique is called ‘hashing’, because the digits are being squashed up (“hashed”)
together (like hash browns).
3. Now play the game using this new searching strategy. You may like to play more than
one game using the same sheet—just choose from different columns.
Note: The spare sheets 3A' and 3B' must be used as a pair, because the pattern of
ships in columns must correspond.)
Discussion Points:
Follow Up Discussion:
Computers can process information very quickly, and you might think that to find something
they should just start at the beginning of their storage and keep looking until the desired
information is found. This is what we did in the Linear Searching Game. But this method is very
slow—even for computers. For example, suppose a supermarket has 10,000 different products
on its shelves. When a barcode is scanned at a checkout, the computer must look through up to
10,000 numbers to find the product name and price. Even if it takes only one thousandth of a
second to check each code, ten seconds would be needed to go through the whole list. Imagine
how long it would take to check out the groceries for a family!
https://csunplugged.org/en/topics/searching-algorithms/sequential-and-binary-search-unit-plan/ho
w-many-guesses/
A better strategy is binary search. In this method, the numbers are sorted into order. Checking
the middle item of the list will identify which half the search key is in. The process is repeated
until the item is found. Returning to the supermarket example, the 10,000 items can now be
searched with fourteen probes, which might take two hundredths of a second—hardly
noticeable.
Additional activity:
https://csunplugged.org/en/topics/searching-algorithms/integrations/drama-video/
A third strategy for finding data is called hashing. Here the search key is manipulated to indicate
exactly where to find the information. For example, if the search key is a telephone number,
you could add up all the digits in the number and take the remainder when divided by 11. In
this respect, a hash key is a little like a small piece of data whose value depends on the other
data being processed. Usually the computer will find what it is looking for straight away. There
is a small chance that several keys end up in the same location in which case the computer will
need to search through them until it finds the one it is seeking.
Computer programmers usually use some version of the hashing strategy for searching, unless
it is important to keep the data in order, or unless an occasional slow response is unacceptable.
Objectives Agenda
Note: Some of the prior methods of doing things may need to be explained to
students that are not familiar with them such as film cameras.
Examples:
Students discuss how written communication has changed the way people
communicate
1. In your team discuss how written communication has changed the way we
communicate. During the American Revolution, people sent letters to each other
which was slow and unreliable. The recipient would have to wait a few days to weeks
for a letter to arrive depending on the destination of the letter. Many people still
write letters, but it has mostly been replaced thanks to new technologies.
2. Discuss what types of written communication people use today and which
technologies have allowed this to change. Write down 2- 3 of your ideas.
3. Discuss and write down the benefits of the new way of communicating.
After the activity, prompt students to share their ideas with the class.
Dogs are some of our best friends. That’s especially true after a disaster, such as an
earthquake. When buildings collapse, search-and-rescue dogs help find people
trapped beneath the rubble. Dogs’ amazing noses can pick up the scent of survivors.
Dogs can also sniff hidden drugs and explosives.
Unfortunately, it is very
expensive to train a dog, they
may not always be up for the
task and they can’t work for
very many years.
These electronic noses will hopefully be able to be used to find survivors like dogs do, but
scientists are also developing them to detect diseases in humans. We might be able to
breathe into a smartphone or a handheld electronic device and it might be able to tell us if we
are sick. As one scientist put it, “Your phone might know you have a cold before you do.”
Optionally show the “How Does an Electronic Nose Work” video if appropriate for your class
(https://tinyurl.com/y2ohhof2).
We learned how an electronic nose can be useful and how it might help in the
medicine field. What if we had an electronic eye device?
Students may work as a team or on their own for this activity (simply tell them to replace
‘our’ with ‘my’ if working alone). Explain the activity to students and distribute the activity
worksheet.
Allow time for students to share and discuss their ideas with the class.
Reflection Points:
Student Activity: Life Changing Electronic Devices
You learned about an electronic nose. Now you will share your own invention! Be
prepared to share with the class. Every team member will share at least one
item.
What to do:
1) Your team had an amazing breakthrough and your new
electronic eye is ready to see where no eye has seen
before!
Our electronic eye is called ______________________
Our electronic eye can see (examples: in the dark, x number of feet away, in
certain places where it is difficult to see,.....)
_________________________________________________________
_________________________________________________________
People can use our device to ____________________________________
_________________________________________________________
_________________________________________________________
Our eye can solve the following problem(s) _________________________
_________________________________________________________
_________________________________________________________
_________________________________________________________
Objectives Agenda
Engage students in an interactive discussion and review of the answers to each of the
exercises.
3. The CPU’s job is to fetch and run instructions and is most like the computer’s lungs.
False Explanation: While it is true that the CPU fetches and runs instructions, the CPU
is most like the computer’s brain.
4. Draw a line connecting the old way of doing things to the new way today
5. To debug means:
a. Wipe bugs off a computer screen
b. Run a test case
Broadcasts
7. Computers often need to search for a single item in a set of data. There are many
searching algorithms.
When a program first sorts the data and then checks the middle of the list to check
which half the item is in and repeats this until the item is found it is called:
a. Linear search
✅ b.
c.
d.
Hashing search
Binary search
Middle search
e. It has no name
8. The linear search is the fastest searching algorithm for lots of data because you don’t have
to sort the data first.
False
3. The CPU’s job is to fetch and run instructions and is most like the computer’s
lungs.
❏ True
❏ False
4. Draw a line connecting the old way of doing things to the new way today
5. To debug means:
7. Computers often need to search for a single item in a set of data. There are
many searching algorithms.
When a program first sorts the data and then checks the middle of the list
to check which half the item is in and repeats this until the item is found it
is called:
e. Linear search
f. Hashing search
g. Binary search
h. Middle search
i. It has no name
8. The linear search is the fastest searching algorithm for lots of data because
you don’t have to sort the data first.
❏ True
❏ False