<a id="ch-13"></a>

## Chapter 13 — Six is high and four is medium

<!-- open-cyber-academy:lesson-figures:start ch-13 -->
### Lesson map

Lesson 13. Map, example, EX059.

```mermaid
flowchart TD
  S["score = likelihood * impact"] --> H{"score >= 6?"}
  H -->|Yes| A["high"]
  H -->|No| M{"score >= 4?"}
  M -->|Yes| B["medium"]
  M -->|No| C["low"]
```

The tests are `>=`. A 6 is already high. A 4 is already medium.

### Logical drawing

```text
F1  6  high
F3  6  high
F4  4  medium
F2  2  low
not in this print
  a 5, a 3, a 9
```
<!-- open-cyber-academy:lesson-figures:end ch-13 -->

### Learning outcomes

After this chapter, you should be able to:

1. State the two thresholds.
2. Place each printed score in its band.
3. Refuse a band the file does not compute for a score it does not hold.

### 13.1 The band is computed. `medium` already fills the width.

After the sort, the loop sets `score = lik * imp` again and then chooses a word. `score >= 6` yields `high`. Otherwise `score >= 4` yields `medium`. Otherwise the word is `low`. The tests are inclusive. Six is not "almost high." Four is not low.

This print contains 6, 6, 4, and 2. It does not contain 5, 3, or 9. A 5 would be medium and a 3 would be low, but saying the lab printed those bands would add rows. The format `{band:6}` asks for a width of 6. `medium` is already six letters, so it receives no extra pad. `high` is four letters, so two spaces are added inside the field before the separator space. `low` is three letters, so three spaces are added. The pad is not a second score.

| Score in this print | Test that matches | Word |
|---:|---|---|
| 6 | `>= 6` | `high` |
| 4 | not `>= 6`, then `>= 4` | `medium` |
| 2 | neither test | `low` |

### 13.2 Worked example

| Offered claim | Threshold | Decision |
|---|---|---|
| "F4 is medium because 4 meets the second test." | `>= 4` after `>= 6` failed | Keep |
| "High starts above 6, so F1 is medium." | 6 passes the first test | Refuse |
| "The lab printed a score of 9." | No tuple multiplies to 9 | Refuse |

> **Synthetic case.** Four products, three words, no extra row.

### Errors and limits

Do not lower the 6 so that F1 and F3 become medium.

### Apply

- **EX059 — Bands.** Which scores in this print are high, medium, and low, and what would a 5 be if it existed? *Rubric:* 3 = 6 is high, 4 is medium, 2 is low; a 5 would be medium because it fails `>= 6` and meets `>= 4`; this print has no 5;; 2 = the three printed bands are right and no extra score is claimed;; 1 = one band;; 0 = none.

<!-- open-cyber-academy:chapter-navigation:start ch-13 -->
### Continue studying — lesson 13 (chapter 13 of 20)

[← Chapter 12](#ch-12) · [Course chapter index](../SUBJECTS.md) · [Chapter 14 →](#ch-14)

Continue to the next authored lesson.
<!-- open-cyber-academy:chapter-navigation:end -->

## Worked answers

<a id="answer-ex059"></a>
**EX059.** Scores 6 are high, 4 is medium, and 2 is low. A 5 would be medium. This print has no 5.
