Printing cost

At a university library, print jobs of up to 10 pages are free for everyone. Longer jobs cost €0.05 per page for students and €0.10 per page for staff. A programmer wrote the rule as one conditional expression, shown in Listing 1.

Listing 1: The printing cost of one job as a conditional expression (Question 1).
def print_cost(pages: int, is_student: bool) -> float:
    return 0.0 if pages <= 10 else 0.05 * pages if is_student else 0.10 * pages

Python groups nested conditional expressions from right to left: A if c1 else B if c2 else C means A if c1 else (B if c2 else C). It evaluates c1 first.

Which flowcharts in Figure 1 give the same cost as Listing 1 for every job?

graph TD
    accTitle: Printing cost, flowchart A
    accDescr: Jobs of up to 10 pages cost 0. Longer jobs cost 0.05 per page for students and 0.10 per page for staff.
    A((Start)) --> B[/"<i>pages</i>, <i>is_student</i>"/]
    B --> C{"Is <i>pages</i><br><= 10?"}
    C -- Yes --> D[/"0"/]
    C -- No --> E{"Is <i>is_student</i><br>True?"}
    E -- Yes --> F[/"0.05 × <i>pages</i>"/]
    E -- No --> G[/"0.10 × <i>pages</i>"/]
    D --> Z((End))
    F --> Z
    G --> Z
(a) Candidate flowchart
graph TD
    accTitle: Printing cost, flowchart B
    accDescr: Students pay 0 for up to 10 pages and 0.05 per page otherwise. Staff always pay 0.10 per page.
    A((Start)) --> B[/"<i>pages</i>, <i>is_student</i>"/]
    B --> C{"Is <i>is_student</i><br>True?"}
    C -- Yes --> E{"Is <i>pages</i><br><= 10?"}
    C -- No --> G[/"0.10 × <i>pages</i>"/]
    E -- Yes --> D[/"0"/]
    E -- No --> F[/"0.05 × <i>pages</i>"/]
    D --> Z((End))
    F --> Z
    G --> Z
(b) Candidate flowchart
graph TD
    accTitle: Printing cost, flowchart C
    accDescr: Jobs of up to 10 pages cost 0.05 per page for students and 0.10 per page for staff. Longer jobs cost 0.
    A((Start)) --> B[/"<i>pages</i>, <i>is_student</i>"/]
    B --> C{"Is <i>pages</i><br><= 10?"}
    C -- Yes --> E{"Is <i>is_student</i><br>True?"}
    C -- No --> D[/"0"/]
    E -- Yes --> F[/"0.05 × <i>pages</i>"/]
    E -- No --> G[/"0.10 × <i>pages</i>"/]
    D --> Z((End))
    F --> Z
    G --> Z
(c) Candidate flowchart
graph TD
    accTitle: Printing cost, flowchart D
    accDescr: The flowchart first asks whether the user is a student. Both branches then give 0 for up to 10 pages, and 0.05 or 0.10 per page otherwise.
    A((Start)) --> B[/"<i>pages</i>, <i>is_student</i>"/]
    B --> C{"Is <i>is_student</i><br>True?"}
    C -- Yes --> E{"Is <i>pages</i><br><= 10?"}
    C -- No --> H{"Is <i>pages</i><br><= 10?"}
    E -- Yes --> D[/"0"/]
    E -- No --> F[/"0.05 × <i>pages</i>"/]
    H -- Yes --> D
    H -- No --> G[/"0.10 × <i>pages</i>"/]
    D --> Z((End))
    F --> Z
    G --> Z
(d) Candidate flowchart
Figure 1: Four flowcharts for the printing cost (Question 1).