Lesson map
Lesson 10. Map, example, EX056.
flowchart TD
M["Twelve mailboxes, in prose"] --> S["Search for an outside rule"]
L["Six sign-in tuples"] --> P["Six printed rows"]
S --> Q{"Do the counts match?"}
P --> Q
Q -->|No| K["Keep both counts in their own places"]
A mailbox search is not a longer sign-in list.
Logical drawing
printed user labels: e.finch, s.marlow, l.barros
printed rows: 6
mailboxes searched: 12
outside-forwarding rule: Elaine's only
other nine mailboxes: no rows in this file
Learning outcomes
After this chapter, you should be able to:
- Separate six printed rows from twelve mailboxes.
- Say which mailbox had the outside-forwarding rule.
- Refuse a 2-of-6 fraction in place of the lines.
10.1 The search result is a sentence. The print is six tuples.
BrightPath searched all 12 mailboxes for rules that forward to an outside address. Only Elaine's mailbox had one. The same search found no other unusual sign-ins. That result is prose. The script prints six rows and stops. It does not loop over twelve mailboxes, and it does not print the words "2 of 6" or "1 of 12".
Three labels appear. e.finch has four rows. s.marlow has one row, Friday 09:10 UK, and it prints ok. l.barros has one row, Friday 08:30 UK, and it prints ok. Those two labels are not full names in this book, and this chapter does not invent names for them. Twelve mailboxes minus the three labels leaves nine mailboxes with no row. Those nine are not "six missing lines", because six is the length of signins, not a count of absent people.
The colleague on holiday in Spain and the partner whose phone roamed are first-month alert explanations. They are not s.marlow and not l.barros. Merging those later alerts into the Friday rows would invent an identity the file does not store.
Lesson table; scroll horizontally to read all columns →
| Count | What it counts |
|---|---|
| 6 | Tuples in signins |
| 3 | Distinct labels in those tuples |
| 12 | Mailboxes in the prose search |
| 1 | Mailbox with an outside-forwarding rule |
| 9 | Mailboxes with no printed row |
10.2 Worked example
Lesson table; scroll horizontally to read all columns →
| Offered rewrite | Why it fails or stands | Decision |
|---|---|---|
| Six lines remain the print | The list length is six | Keep |
| Only Elaine's mailbox had the rule | Prose search | Keep, as prose |
| "The lab found 2 of 6 attacks." | The file prints no such fraction | Refuse |
| "s.marlow is the Spain holiday." | Different facts, no shared identity | Refuse |
Synthetic case. Nine mailboxes stay unnamed.
Errors and limits
Do not lengthen the list to twelve so the search looks like output.
Apply
- EX056 — Two counts. A classmate writes "2 of 6" on the print and says the other ten mailboxes were the ok rows. How many rows does the script print, how many mailboxes were searched, and whose mailbox had the outside-forwarding rule?
Show marking criteria
Rubric: 3 = six rows; twelve mailboxes in prose; only Elaine's rule;s.marlowandl.barrosstay ok rows; do not print 2 of 6;; 2 = six rows and twelve mailboxes stay apart;; 1 = one count;; 0 = none.