graph TD
accTitle: Delivery fee flowchart
accDescr: Members and orders of 50 euros or more get a fee of 0, other orders a fee of 4.95. A bulky item then adds 15 to the fee.
A((Start)) --> B[/"<i>total</i>, <i>is_member</i>, <i>is_bulky</i>"/]
B --> C{"Is <i>is_member</i><br>True?"}
C -- Yes --> E["<i>fee</i> = 0"]
C -- No --> D{"Is <i>total</i><br>>= 50?"}
D -- Yes --> E
D -- No --> F["<i>fee</i> = 4.95"]
E --> G{"Is <i>is_bulky</i><br>True?"}
F --> G
G -- Yes --> H["<i>fee</i> = <i>fee</i> + 15"]
G -- No --> I[/"<i>fee</i>"/]
H --> I
I --> Z((End))
M4) Delivery fee
A web shop charges a delivery fee in euros. Members never pay the standard fee. Other customers pay no standard fee on orders of €50.00 or more, and €4.95 below that. An order with a bulky item, such as a bookcase, costs an extra €15.00 on top of whatever the standard fee is, including when that fee is 0.
Figure 1 shows the rule as a flowchart.
Listing 1 shows 4 implementations of delivery_fee.
delivery_fee (Question 1).