# Unit 5 – Advanced Practice: Timer

This practice extends the basic Timer. The elapsed count is now directly 
visible, and a new indicator automatically reflects whether the time 
limit has been reached.

## Instructions

### Timer

1. The constructor takes the same parameters as before — no new settings 
   are needed.
2. Store `maxSeconds` as a `private val` in the class body so that method 
   bodies can use it.
3. Think about how `elapsed` should change compared to the basic version: 
   external code should now be able to read it, but still not write it. 
   What modifier makes that possible?
4. Add a computed property `isExpired`. Think about what makes it 
   computed rather than stored, and what condition it should express.
5. Implement `tick()`, `reset()`, and `status()` — the same behaviour as 
   before, but use `isExpired` where it simplifies the logic.

### Testing

1. Create `Timer("Exam", 3)`.
2. Read `elapsed` directly — this should now work, returning `0`.
3. Call `tick()` three times, reading `elapsed` after each — the value 
   should be visible from outside the class.
4. Read `isExpired` — should return `true`.
5. Call `tick()` again — the expired message should appear; `elapsed` 
   should not increase.
6. Call `reset()` and confirm `elapsed` returns to `0` and `isExpired` 
   returns `false`.
7. Try `Timer("Bad", 0)` — `init` should reject it with an error.
