Exercise 2: Adding a Fourth Business Step — Possible Solution ==================================================================== THE ADDITION ------------------------------ def award_loyalty_points(order, total): pass # stubbed def process_order_clean_v2(order): total = calculate_order_total(order) log_order(order, total) send_confirmation_email(order['customer_email'], total) award_loyalty_points(order, total) # new fourth step return total The new call follows the exact same shape as the three existing ones - a single named function call, no raw arithmetic, no string formatting, no direct file or dict manipulation inline. VERIFYING THE TOP-LEVEL FUNCTION STAYS AT A SINGLE LEVEL ------------------------------ process_order_clean_v2 - high-level calls: 4 | low-level operations: 0 Running this chapter's own classify_lines() check against the updated function: 4 high-level calls (up from this chapter's own 3), and low-level operations stayed at exactly 0 - unchanged. VERIFYING THE RESULT IS STILL CORRECT ------------------------------ result: 80.0 (expected 80.0) Adding the new step didn't change the function's own core computation - the gold-tier order still correctly totals to 80.0, matching this chapter's own original result. WHY THIS CONFIRMS THE SINGLE-LEVEL PATTERN SCALES ------------------------------ Adding a fourth genuinely different business concern (loyalty points, on top of totaling, logging, and email) required zero low-level detail to leak into the top-level function - because the pattern this chapter established (push detail down into named functions, keep the top level as pure orchestration) doesn't get harder to maintain as more steps are added. Each new step is just one more line reading at the identical altitude as every line already there. WHY THIS WORKS AS AN ANSWER ------------------------------ The new step follows this chapter's own established single-call pattern exactly, the classification check is re-run using this chapter's own unmodified method, and both the abstraction-level count and the correctness of the result are verified directly rather than assumed to hold after the addition.