Computer Science Grade 2 20 min

The Incorrect Sound

Identifying the sound that doesn't match the others.

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Identify when a program has an 'incorrect sound' bug. Define the words 'bug' and 'debug' using simple terms. Look at code blocks one by one to find a mistake. Change a code block to fix an incorrect sound. Test their program again to see if their fix worked. Explain why the program made the wrong sound. Have you ever pushed a toy cat's button and heard a dog bark? 🐱➡️🐶 That's a surprise! We will learn about little mistakes in code called 'bugs'. Then, we will become detectives 🕵️ and learn how to 'debug' or fix them! Real-World Applications Fixing a toy that makes the wrong noise. Figuring out why a video game character won't jump. Telling a grown-up which button on the remote isn...
2

Key Concepts & Vocabulary

TermDefinitionExample Bug 🐞A bug is a small mistake in the code.Telling a cat character to 'bark' is a bug. Debug 🕵️To debug means to find and fix a bug.Changing the 'bark' sound to 'meow' is debugging. Code Block 🧩A code block is like a puzzle piece with one instruction.A yellow block that says 'When clicked'. Sequence ➡️A sequence is the order your code blocks run.First, click the cat. Second, it plays a sound. Event 🎉An event is an action that starts your code.Clicking on a character is an event. Sound Block 🎵A code block that tells the computer to play a sound.A pink block that says 'Play sound meow'.
3

Core Syntax & Patterns

One Step at a Time Check one block, then the next. Don't skip! When you debug, read your code blocks in order, just like reading a book. Match the Action The picture should match the sound. 🐱➡️🎵 Make sure the character on the screen does what you expect. A cat should meow.

4 more steps in this tutorial

Sign up free to access the complete tutorial with worked examples and practice.

Sign Up Free to Continue

Sample Practice Questions

Challenging
A story has a knight, a dragon, and a princess. When the knight appears, a 'Trumpet' sound should play. When the dragon appears, a 'Roar' sound should play. The code plays a 'Roar' for the knight and a 'Trumpet' for the dragon. What is the most likely mistake?
A.The programmer used the wrong sprites.
B.The sound files are broken.
C.The 'Roar' and 'Trumpet' sound blocks were swapped in the code.
D.The princess sprite is missing.
Challenging
You are making a game where a player collects coins. Each time a coin is collected, a 'Ching!' sound should play. Instead, the game is silent. You check the coin's code and see a `play sound "Ching!"` block. What could be the problem if the sound block IS correct?
A.The computer's volume is turned off.
B.The 'Ching!' sound file is empty or broken.
C.The code that detects collecting the coin is not working, so the sound block is never reached.
D.All of the above are possible.
Challenging
Your code has a `repeat 10 times` loop. Inside, it should alternate between a 'Tick' and a 'Tock' sound to make a clock. Instead, it only plays 'Tick' 10 times. Which of these code structures would fix the bug?
A.`repeat 10 times` -> `play sound "Tick"`
B.`repeat 5 times` -> `play sound "Tick"` -> `play sound "Tock"`
C.`repeat 10 times` -> `play sound "Tock"`
D.`play sound "Tick"` -> `play sound "Tock"` (with no loop)

Want to practice and check your answers?

Sign up to access all questions with instant feedback, explanations, and progress tracking.

Start Practicing Free

More from Finding the Missing Piece: Introduction to Debugging

Ready to find your learning gaps?

Take a free diagnostic test and get a personalized learning plan in minutes.