Remember a Story Choice
Apply each Take as a replacement, and let Look report the current held item.
About 18 minutes, plus any extended practice
Supplied materials
- Paper and pencil; answers may also be spoken or typed.
- All cases, labels, numbers and rules are supplied on this page. No real account, private information or purchase is needed.
Learn the idea
State is information a program keeps about its current situation. A story can store a chosen item and later describe it. Our model replaces the held item whenever Take runs; Look reports the held item without changing it. This is different from storing every past item.
Apply each Take as a replacement, and let Look report the current held item. Do not assume a single current-item field keeps a list of all earlier items.
Use this supplied case: Take Key; Look. Start held=none. What does Look report after the stated events? Use the details in this example. Say which detail helped you choose. This pretend example does not tell us how every real system works.
- Follow the worked example one step at a time. Say or draw what happens.
- Apply each Take as a replacement, and let Look report the current held item.
- Say which detail makes the example answer fit. Pick another answer and say why it does not fit.
- Try the question and practice questions. Read the rule again if your answer does not match the explanation.
See the method in action
Take Key; Look. Start held=none. What does Look report after the stated events? The supported answer is Key. Apply each Take as a replacement, and let Look report the current held item. Do not assume a single current-item field keeps a list of all earlier items. The supplied facts, rather than an assumed real-world detail, determine this paper case. Compare the recorded action or value with the stated rule before choosing an answer.
Check your reasoning
Your answer is temporary and is not saved to an account. Download your current answer before leaving or reloading. Written work on paper or in another app stays in your own file.
Helpful tips
- Apply each Take as a replacement, and let Look report the current held item.
- Do not assume a single current-item field keeps a list of all earlier items.
See the answer and explanation
Map
The supplied case states: Take Map; Look. Start held=none. What does Look report after the stated events? Under the stated distinction, this identifies Map. State is information a program keeps about its current situation. A story can store a chosen item and later describe it. Our model replaces the held item whenever Take runs; Look reports the held item without changing it. This is different from storing every past item. Apply each Take as a replacement, and let Look report the current held item.
Take it further
New state: held=Lamp; Take Map replaces it; Look does not change it. Expected: Look reports Map and the current field remains Map.
Nothing here is saved to an account or sent to a teacher. The answer download includes your current choice and any checked feedback. It does not include choices from the separate More practice section. Download that section separately.
More practice: try new cases
Choose an answer for each problem. Explain your method on paper, then use the feedback to decide what to revisit.
Your choices are temporary. Feedback appears after you check all the answers.
Nothing here is saved to an account or sent to a teacher. Keep your own notes or download them before leaving. The score describes these questions; it does not certify subject mastery.
Check the subject sources
These LifeStarter passages, scenarios and exercises are authored for this Academy with AI assistance and review. External resources keep their publishers’ terms. A grade label suggests a starting level; it does not establish alignment with your school’s complete requirements.