Comprehensive and Detailed Explanation From Exact Extract:
The program applies service fees based on two independent conditions: (1) if tickets are printed and mailed, and (2) if tickets are delivered overnight. According to foundational programming principles, multiple independent conditions are best handled by separate if statements, as each fee is applied conditionally and does not require iteration.
Option A: "While loop." This is incorrect. A while loop is used for repeated execution, but applying fees is a one-time decision per ticket order, not a repetitive task.
Option B: "Do-while loop." This is incorrect. A do-while loop guarantees at least one iteration, which is unnecessary here, as the fee application is a single check.
Option C: "If statement." This is incorrect. A single if statement can handle one condition, but two independent conditions (mailed and overnight) require separate checks.
Option D: "Multiple if statements." This is correct. Two if statements can independently check each condition and add the corresponding fee. For example, in Python:
total = ticket_cost
if mailed:
total += mail_fee
if overnight:
total += overnight_fee
Certiport Scripting and Programming Foundations Study Guide (Section on Control Structures: Conditionals).
Python Documentation: “If Statements” (https://docs.python.org/3/tutorial/controlflow.html#if-statements).
W3Schools: “C If Statement” (https://www.w3schools.com/c/c_if_else.php).