imperative / any
Analogy
Collected by Jan Pearce — Own practice
Builds from the notion of a 'Variable as a Parking Space' and leverages the notion that spaces in larger parking lots are often numbered.
PL | NM |
---|---|
array | row of spaces in a parking lot |
array element | car |
element index | space number in lot |
element value | specific car in a specific value |
The use of indices in arrays as ell as the array's construction from contiguous adjacent variables in memory.
Short time to introduce, but learners need to be familiar with parking lots and how someone might locate a specific car in a row in a parking lot.
In a statically typed language one can discuss rows that are for cars only, trucks only, motorcycles only, etc.
Do you have feedback on this notional machine? Did you find a mistake, or do you have a request for improvement? You can create an Issue on GitHub, where the description is hosted. This way we can see your feedback and address it.
For this, you need a GitHub account. Then follow this link to see the source file of this page. In there, click the ... left of the highlighted line, then pick "Reference in a new issue".