HelioLearnSkills for every stage

GRADE 6 · COMPUTATIONAL THINKING · ABOUT 45 MINUTES

Validate before calculating

Check whether an input fits the rule.

Understand the idea

Validation checks a stated rule. For a whole-number count from 0 to 20, negative values, fractions and values over 20 should be rejected.

WORKED EXAMPLE

Input 12 is numeric, whole and within 0-20. It is accepted. Input 2.5 fails the whole-number test.

Watch it step by step

Step 1 of 4
TRACE THE STATE · READ THE EXPLANATION BELOWStep 112Step 2…Step 3…Step 4…Each state follows the specific rule in this workedexample.

Receive

Example input is 12.

Choose Play to advance steps automatically.

Read or choose any step
  1. Receive

    Example input is 12.

  2. Type

    Check that the value is numeric.

  3. Rule

    Check whole number and 0 ≤ value ≤ 20.

  4. Result

    Accept 12; reject 2.5 for this count.

TRY BEFORE CHECKING

Exercises with feedback

Enable JavaScript for feedback, or use the printed exercises.

MAKE SOMETHING YOU CAN EXPLAIN

Your practical challenge

Draw a validation flowchart and test -1, 0, 12, 20 and 21. Include a fractional case.

Review your evidence

These ticks are your self-review. They do not automatically assess project quality. Ask an adult or partner to review what you can show.

Use the skill in a new situation

Explain why numeric text may need careful conversion.

Choose a different space for another learner on this browser.

Notes and checks use this browser, separate from school sign-in.

Each space keeps each grade separate. These spaces are not private accounts; use separate browser profiles for privacy on a shared device. About your practice data

Next: Recognise manipulation in a message →All six experiences