Grade 5 · unit review

Review: Validate and Test Reusable Rules

Test inclusive thresholds, validate inputs and count results from a reusable rule.

Bring the unit skills together

Use these 4 new cases to check your reasoning. Choices are temporary and are not saved to an account, sent to staff or recorded as school grades. Download your current review choices before leaving or reloading.

Unit review questions
1. A fictional goal is at least 15 tokens. Which messages belong to inputs 14, 15, 16 in order?
2. Contract: whole numbers 0 through 20; valid values at least 8 get reached. What happens to 21?
3. status(pages, goal) returns reached when pages ≥ goal. What is status(11, 12)?
4. Accept whole numbers 0 through 20 and count accepted values ≥ 8 in [7, 8, 20, 21]. What count results?

The download contains your current choices and any checked feedback. Keep the separate transfer-task work in your own document; downloading its instructions does not mark it complete.

Use the skills in a new task

Design a paper checker accepting whole-number counters 0 through 18. Its goal parameter is 6. Write expected outputs for 5, 6, 7 and 19; count reached results in [5, 6, 19, 8]; then change the goal parameter to 8 without changing the contract.

Work on paper or in your own document. Explain the choices you made.

  • Validate first and reject 19.
  • Test below, at and above 6: continue, reached, reached.
  • Count 2 reached results in the list at goal 6.
  • At goal 8 count 1 reached result, from 8.
Compare with a model response

If counter is not a whole number in 0..18, return invalid; otherwise return reached if counter ≥ goal, else continue. Tests with goal 6: 5 → continue; 6 → reached; 7 → reached; 19 → invalid. List outputs: continue, reached, invalid, reached; reached count 2. With goal 8: continue, continue, invalid, reached; count 1.

A different response can also meet the criteria. Compare the evidence and reasoning, rather than copying the wording.