Computer Science Grade 2 20 min

The Upside-Down Picture

Identifying an upside-down or rotated picture in a set.

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Define the word 'bug' as a mistake in code. Define 'debugging' as the process of finding and fixing bugs. Identify a bug in a short sequence of code blocks. Explain why the order of code blocks is important. Correct a bug by changing or reordering a single code block. Test their code after a fix to see if it works. Oh no! Our code was supposed to draw a happy cat, but it's upside down! 🙀 How can we fix it? Today, we will become code detectives! 🕵️‍♀️ We will learn how to find mistakes, called bugs. Then we will learn how to fix them, which is called debugging! Real-World Applications Fixing a toy that is built wrong Finding a lost sock in your room Figuring out why a tower of blocks fell over Following a recipe in the...
2

Key Concepts & Vocabulary

TermDefinitionExample Bug 🐞A bug is a little mistake in your code. It makes the computer do the wrong thing.You wanted to draw a blue circle, but a red circle appeared. The 'red color' block is a bug! Debugging 🕵️Debugging is when you act like a detective. You hunt for the bug and fix it!You look at your code and find the 'red color' block. You change it to 'blue color'. That's debugging! Code 💻Code is a set of instructions for the computer. It tells the computer exactly what to do.The blocks 'Move Forward', 'Turn Left', and 'Say Hello' are all pieces of code. Program 🤖A program is all the code instructions put together. It's a full plan for the computer to follow.A program to draw a square has four 'Move Forwar...
3

Core Syntax & Patterns

One Step at a Time Look at each code block, one by one. Don't try to fix everything at once. Check your first block. Is it right? Then check the next one. Match the Plan Compare your code to your goal. Look at the picture you want to make. Does your first block of code match the first part of the picture? Test Your Fix Run your code again after you change something. After you fix what you think is the bug, press 'Run' to see if your program works now. ✅

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 program should draw a sun with 8 rays. It draws an upside-down sun with only 4 rays. What is the BEST way to start debugging this?
A.First, fix the loop that draws the rays from 4 to 8
B.Delete all the code and start over
C.First, fix the block that makes it upside-down
D.Change the color of the sun to orange
Challenging
The code to draw a rocket ship is perfect, but the rocket still appears upside-down. The drawing code is inside your main block. What could be a bug OUTSIDE your drawing code?
A.block at the very beginning that flips the whole screen
B.The rocket ship file is saved with the wrong name
C.The computer's monitor is physically upside-down
D.The code is in the wrong language
Challenging
A loop is supposed to draw a fence with 10 posts: `REPEAT 10 times [Draw Post, Move Right]`. The posts are all drawn in one spot. You see the `Move Right` block is set to move `0` steps. Where is the bug?
A.In the `REPEAT 10 times` block
B.In the `Draw Post` block
C.In the number inside the `Move Right` block
D.The computer is tired

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.