# Unit 6 – Advanced Demo: School Staff

A school is building an online staff directory where every entry lists
what the person teaches — or notes that they don't, if they're an
administrator. This demo extends the basic staff system to fill in that
field for any staff member and count how many teachers are in the group.

## Setting up

1. Compile `StaffMember`, `Teacher`, `Administrator`, and
   `StaffDirectory`.

## Experimenting

2. Create `Teacher("Ms Patel", "T001", "Mathematics")` and
   `Administrator("Mr Lee", "A001", "Finance")`.
3. Call `introduce()` on both — the same greetings as in the basic demo.
4. Create a `StaffDirectory`. Call `add(teacher)` and
   `add(administrator)` on it.
5. Call `countTeachers()` on the directory — the result is `1`.
6. Call `printRoster()` on the directory — both members introduce
   themselves in order.
7. Call `subjectFor(teacher)` on the directory — you get `"Mathematics"`.
   Call `subjectFor(administrator)` — you get `"N/A"`.

## What to look at in the code

8. Open StaffDirectory and find `subjectFor()`. It checks whether the
   staff member is a teacher, and if so asks for their subject directly —
   something you can only do once you know it is a teacher. Notice that
   after the check, Kotlin already knows the type and lets you access
   `subject` without any extra steps.
9. Find `printRoster()`. It calls `introduce()` on every person in the
   list without ever asking what kind of staff member each one is — the
   right introduction comes out automatically depending on the actual
   type.
