F15 · Topic 3.12
Procedure call tracer
1. Predict first
quote(base,perItem,count)returns base+perItem*count. Predict quote(5,2,3)and quote(2,5,3), then the caller result quote(5,2,3)+1.
Change it · step through · explain
Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.
Ready · Make a prediction
- Input 15Waiting
- Input 22Waiting
- Input 33Waiting
Ready to experiment
Why: Predict the first change, then advance one step.
Try this: Change one input, predict the difference, then reset and compare.
2. Build your procedure
Write quote with its three parameters and RETURN. Trace each parameter and explain why replacing RETURN with DISPLAY breaks a caller that adds 1.
Use AP CSP pseudocode, a language you know, or precise plain language. Your code is not executed here. Use the classroom assignment to save your response.
3. Check boundaries
| Input | Expected | Why this case |
|---|---|---|
| base 5,perItem 2,count 3 | Return 11; caller plus 1 is 12 | Argument order and returned result. |
| base 2,perItem 5,count 3 | Return17 | Exposes a swap concealed by some inputs. |
| base 5,perItem 2,count 0 | Return5 | Zero items still retain the documented base charge. |
4. Explain and reflect
Why would quote(4,4,3)be a weak test for swapping the first two arguments?
Model limits: A fictional arithmetic contract. It is not a pricing recommendation, payment system or general procedure interpreter.