Array as Row of Parking Spaces

Programming Language

imperative / any

Form

Analogy

Attribution — Origin / Source

Collected by Jan Pearce — Own practice

Conceptual Advantage

Builds from the notion of a 'Variable as a Parking Space' and leverages the notion that spaces in larger parking lots are often numbered.

Mapping

PLNM
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

Draws Attention To

The use of indices in arrays as ell as the array's construction from contiguous adjacent variables in memory.

Use When

not captured

Cost

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.

Details

In a statically typed language one can discuss rows that are for cars only, trucks only, motorcycles only, etc.

Comments or Feedback?

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

Create an Issue on GitHub