Skip to content
Your progress

Checking your sign-in…

Who's learning?

Each profile keeps its own read lessons, badges, streak, and practice scores on this device.

Lesson 5 of 8

Predict, run, compare

Show on a big screen

6 min

Text size

A library fine is money for a late book: ₹1 a day. After more than 7 days late, you see the teacher. A chart is pinned above the desk. Does the chart match the rule?

Read the days late.
Step 1 of 5
  1. Read the days late.
  2. The diamond asks: 7 days or more?
  3. A book 7 days late: Yes.
  4. The chart says: see the teacher.
  5. The rule says: pay ₹7.

No. For a book 7 days late, the chart and the rule differ.

The rule

Predict first. Run it. The first difference points to the bug. A bug is a mistake in a plan or program.

The rule says you see the teacher after more than 7 days. Find the book where the chart and the rule differ. A "7 or more" check includes 7. "More than 7" does not.

Watch out!

A chart that passes one test can still be wrong. The limit is the number where the rule changes. Try the day right at the limit too, here 7 days.

Make the chart agree with every book.

Loading lab…

Try the lab to finish this lesson.