Skip to main content

Featured

Space Explorers Book 7: Answers and Explanations

Memunic Space Explorers › Book 7: Memoon and the Search for Another Home › Answers and Explanations Answers and Explanations Habitable means life could live there; inhabited means life does live there. A world can be habitable and empty, as an unoccupied flat has a roof and water but nobody in it. The Moon has almost no air, so water would boil or freeze, and its gravity is only about one-sixth of Earth’s, too weak to keep air. Accept also: no greenhouse blanket, so it swings between very hot and very cold. Venus. It matches Earth in size and roughly in mass, but its thick carbon dioxide air traps heat, making it hot and crushing. “Twin” is only true for size and weight. A dip of 1 per cent means (planet width divided by star width) squared is 0.01, so the ratio is 0.1: the planet is about a tenth as wide as the star. Repeats at the same gap show the planet is going round the star in 12 days, and rule out a one-time event such as a passing object. A planet shines only by reflected l...

Byte by Byte Book 1: Chapter 10 – Bugs and Debugging

Byte by Byte › Book 1: Computer Basics › Chapter 10: Bugs and Debugging

Chapter 10: Bugs and Debugging

You will learn: what a bug is, and the four steps to find and fix one.

🌟 The Adventure

The Queen of Memunic had a special job for the friends. "Bleep must deliver my party invitations to the Post Box. Can you write his instructions?"

"Me! Me! Let me do it!" Noodles bounced up and down. He looked at the map quickly and wrote:

→ ↑ ↑ →

Bleep beeped happily. "FOLLOWING INSTRUCTIONS!" He rolled one square right. Then one square up... SPLASH! He rolled straight into the pond.

Bleep's antenna poked out of the water, dripping. "BLUB. INSTRUCTIONS FOLLOWED. INVITATIONS... WET."

Noodles' ears drooped. "I ruined everything. I'm a terrible programmer."

Simbha lay down beside him and wrapped him in his soft mane. "No, little one. You made a mistake. Every programmer makes mistakes. The important thing is what you do next."

Illustration from Byte by Byte Book 1: Chapter 10 – Bugs and Debugging

💡 Learn With Memoon

What is a bug?

A mistake in a computer's instructions is called a bug. When there's a bug, the computer does something we didn't want, like rolling into a pond!

A famous story tells of a real moth found stuck inside an early computer in 1947. The team taped it into their notebook. Programmers still use the word "bug" for mistakes today.

What is debugging?

Finding and fixing bugs is called debugging. All programmers debug, even the very best ones. Mistakes are a normal part of learning.

The four debugging steps

  1. Test: follow the instructions and watch what happens.
  2. Find: go through the steps one by one. Find the exact step where things went wrong.
  1. Fix: change that step.
  2. Test again: follow the fixed instructions to make sure they work now.

Common kinds of bugs

BugExample
A wrong step↑ written where it should be →
A missing stepForgetting "peel the banana"
Steps in the wrong orderShoes before socks
An extra stepOne arrow too many

💡 Memoon's tip: Don't rub everything out and start again. Look for the one step that went wrong. Usually, most of your instructions are already right!

Illustration from Byte by Byte Book 1: Chapter 10 – Bugs and Debugging

✍️ Try It Yourself

Activity 1: Debug Bleep's path (No computer needed)

Here is the map. is Bleep. is the Post Box. trees and the pond block the way. squares are safe.

Col 1Col 2Col 3

Row 1

Row 2

Row 3

Noodles wrote: → ↑ ↑ →

  1. Test: put your finger on Bleep and follow each arrow. Where does he end up?
  2. Find: which step is the bug?
  3. Fix: write the correct instructions.
  4. Test again: follow your fixed instructions with your finger.

Activity 2: Debug Kachui's river (No computer needed)

Look back at the Whirly River map in Chapter 8. Someone wrote these steps for Kachui: ↑ → ↑ ↑ → ↑

Follow them with your finger. Which step makes Kachui fall into a whirlpool? Fix it.

Activity 3: Debug the recipe (No computer needed)

Find the bug in these instructions for making a glass of lemonade.

  1. Fill a glass with water.
  2. Drink it.
  3. Squeeze a lemon into the glass.
  4. Add a spoon of sugar and stir.

Activity 4: Grown-up's secret bug (No computer needed)

Ask a grown-up to write simple instructions for drawing a smiley face, with one bug hidden inside. Follow them exactly. Can you find and fix the bug?

🎉 Memoon Solves It

Noodles sniffed and picked up the map. "Okay. Debugging. Step one: test." He put his paw on Bleep's square and followed his arrows. "Right. Up... splash! That's where it went wrong. Step two!"

"So the second step is the bug," said Memoon gently. "What should it be?"

Noodles looked carefully. "If Bleep goes right again, he stays on the path. Then up, up!" He crossed out his old arrows and wrote:

→ → ↑ ↑

"Step four: test again!" He traced it with his paw. Right, right, up, up. "It reaches the Post Box!"

Nimo blew a big bubble and floated Bleep out of the pond. The Queen gave Bleep a fresh pile of dry invitations.

"FOLLOWING NEW INSTRUCTIONS!" Right. Right. Up. Up. Clunk! The invitations dropped into the Post Box.

Everyone cheered. Noodles puffed out his fluffy chest. "I found a bug, and I fixed it! I'm a debugger!"

"You're a real programmer," said Simbha with a proud smile.

❓ Check Your Knowledge

A. Fill in the blanks

  1. A mistake in a computer's instructions is called a .
  2. Finding and fixing mistakes is called .
  1. After you fix a bug, you should again.

B. Put the debugging steps in order: Fix · Test again · Test · Find

C. True or False

  1. Only bad programmers make mistakes.
  2. When there's a bug, you should always start again from nothing.
  3. A missing step can be a bug.

D. Find the bug: "To post a letter: 1. Walk to the post box. 2. Drop the letter in. 3. Write the letter. 4. Put it in an envelope." What's wrong? Fix it.

📚 Word Bank

  • Bug: a mistake in a computer's instructions.
  • Debugging: finding and fixing bugs.
  • Test: try out instructions to see if they work.
  • Fix: change something so it works correctly.

Keep learning with Byte by Byte

Explore Book 1: Computer Basics. Find the ebook, purchase details and teaching slides on MemuniCity.

Watch this chapter on YouTube

Comments

Popular posts from this blog

CA-7 Job Status and Failure Reason Codes

Here are the various status codes that You may see for jobs in the Queue or Logs in CA-7. R-C0002 R-C0003 R-C0099 R-C0255 R-JCLER A-U0002 A-U0004 A-U0015 A-U0043 A-U4095 A-SOC7 A-U4000 Reason Code/Job Status Code explanation: The indication of the job's current disposition. Values and their meanings are: A-Snnnn-- The job has failed with a system abend. A-Unnnn --The job has failed with a user abend. C-Cnnnn --The job has completed successfully and is going through completion processing. E-ARFATT-- An error occurred during the attempt to attach ARF definitions. This can result if the ARFSET specified is not defined. A diagnostic message may have been written to the CA-7 log, the OS console, or to the trailer queue for the job (in which case it can be displayed using LQ,JOB=x,LIST=ALL). E-ARFERR ---The job encountered an error in the ARF processing. Do a LARFQ command for the job to get more specific information. E-SEGERR --The job has been requeued...

Whistling Winds and Waterfalls: 4 Days of Magic in Shillong

Nestled in the clouds, where the scent of pine trees mingles with the rhythm of waterfalls and the tunes of local guitar-strumming youth—Shillong is more than a place. It’s a vibe. If you’ve got 3 nights and 4 days, you’ve got just enough time to fall in love. Here’s how to make the most of it—food, fun, fog and fantastic views included. Day 1: Shillong, We’re Coming for You! You land in Guwahati, barely out of the airport when the hills start calling. You hop into your cab, Spotify on, windows down, and the three-hour ride to Shillong begins. Just when you think it can’t get better, you stop at Umiam Lake —a lake so calm, it looks like someone ironed the water. By evening, you’re sipping hot chai in Laitumkhrah, maybe nibbling on spicy momos or pork jadoh from a roadside stall. You’re checked into your charming hotel ( Tripura Castle if you fancy old-world royalty, Ri Kynjai if you’re into lakeside poetry). The breeze whispers secrets of waterfalls and pine forests. Sleep well, drea...

Installing and Configuring Hadoop on Ubuntu as a Pseudo Distributed Single Node Cluster

Briefly what is psuedo-distributed single node Hadoop cluster: It is a Hadoop distributed cluster having Single Node. All the five daemons (NN,DN,JT,TT,SNN) are running as individual JVM (java process) instances. We will get all distributed features of Hadoop. This mode is used to develop, test, and staging (before production) Map Reduce programs quickly. It writes all the system, daemon and user logs to different files on the cluster To install Hadoop in this mode, we have to modify the hadoop-env.sh, core-site.xml, hdfs-site.xml, mapred-site.xml. hadoop-env.sh contains all the Environment variables which are required for running Hadoop. All the default values are fine, Only we have to modify the JAVA_HOME=“The location of Java Home Directory” Core-site.xml contains all the cluster specific information like io, temp directory, sorting, file system uri etc. Hdfs-site.xml contains all the parameters which are specific to HDFS like name node directory, data node directory...