Grade 7 · unit review

Review: Organize Programs into Clear Responsibilities

Design a paper helper for doubling a nonnegative integer count. State its contract, distinguish return from printing and give a valid example without modifying shared state.

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. Function prints a label and reaches its end. Classify the stated function behavior.
Need a hint?
  • Track the caller’s returned value separately from visible output.
  • Do not substitute printed text for the return value.
2. Function updates a global record. Which role is described?
Need a hint?
  • Distinguish a local temporary, returned result and stated external side effect.
  • Two functions using the same local name do not automatically share one variable.
3. Build the reader-facing result sentence. Which helper fits the stated job?
Need a hint?
  • Assign each helper a coherent responsibility with a stated input and result.
  • A helper name does not prove the helper actually has one responsibility.
4. Produces a numeric result. Classify this contract statement.
Need a hint?
  • Match the requested documentation element to its role in the contract.
  • An example is useful but does not replace an input rule.

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 helper for doubling a nonnegative integer count. State its contract, distinguish return from printing and give a valid example without modifying shared state.

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

  • Use only supplied fictional inputs and state the relevant rule.
  • Include labeled steps or evidence for each decision.
  • Name one limitation or tempting mistake.
  • Check that the result meets the task and revise a justified error.
Compare with a model response

The helper accepts a nonnegative integer and returns twice that value. For input 4 it returns 8. Printing "8" alone would not provide a numeric return. Its calculation uses local work and performs no file or shared-record changes.

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