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.
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.