# Unit 4 – Advanced Practice: TaggedTodoList

Real to-do apps let you tag tasks by area — work, home, health — so you 
can see at a glance where your attention is needed. This practice builds 
on the Basic todo list: each task now has a category, chosen from a set 
of platform-defined options that are fixed for every list.

## Instructions

### `TaggedTodoList`

1. The constructor takes only a title. The allowed categories and their 
   display labels are already declared as `categories` and 
   `categoryLabels` — notice their types. Add two more properties to 
   store the tasks and their assigned categories; think about which type 
   of collection is right for each.
2. Implement `addTask(task, category)` — if `category` is not in the 
   allowed list, stop and signal the problem; otherwise add the task, 
   record its category, and print a confirmation showing the full label, 
   e.g. `"Added: Buy milk [Home & Chores]"`.
3. Implement `removeTask(task)` — remove the task from both collections 
   and print `"Removed: <task>"`.
4. Implement `printCategory(category)` — print a header with the 
   category's label, then each matching task on its own line. If no 
   tasks belong to that category, print `"(none)"`.
5. Implement `printAll()` — if empty, print `"No tasks in '<title>'."`; 
   otherwise print `"=== <title> ==="` followed by each task numbered 
   from 1 with its label in brackets.
6. Implement `taskCount()` — return the total number of tasks.
7. Implement `countInCategory(category)` — return how many tasks belong 
   to that category.

### Testing

1. Create `TaggedTodoList("Work Week")` on the Object Bench.
2. Call `addTask("Finish report", "work")`,
   `addTask("Buy groceries", "home")`, and
   `addTask("Send email", "work")`.
3. Call `printAll()` — expect:
   ```
   === Work Week ===
   1. Finish report [Work Tasks]
   2. Buy groceries [Home & Chores]
   3. Send email [Work Tasks]
   ```
4. Call `printCategory("work")` — expect a header and the two work tasks.
5. Call `countInCategory("home")` — expect `1`.
6. Call `taskCount()` — expect `3`.
7. Call `addTask("Walk dog", "leisure")` — `"leisure"` is not in the
   allowed list; expect an error.
8. Call `removeTask("Buy groceries")`, then `printAll()` — only the two
   work tasks remain.
