ITPEC FE Subject B April 2024 Question 2
ITPEC FE Subject B April 2024 — Question 2 of 20
Determining when a discount condition applies using or vs and.
The discount price ($10) applies when any of these is true: age ≤ 10, age ≥ 60, or the passenger is a registered member. Since all three conditions independently qualify for the discount, they must be joined with or:
((age ≤ 10) or (age ≥ 60)) or isMember
Why not others:
- (a) `((age ≤ 10) and (age ≥ 60)) and isMember` — requires all three conditions simultaneously; age ≤ 10 and age ≥ 60 is logically impossible, so nobody ever gets the discount
- (b) `((age ≤ 10) and (age ≥ 60)) or isMember` — the age part is still impossible, so only members get the discount (children and seniors are excluded)
- (c) `((age ≤ 10) or (age ≥ 60)) and isMember` — age-based discount only works if the passenger is also a member; a non-member child or senior pays full price, which contradicts the problem
Key rule: when multiple independent conditions each qualify for the same outcome, connect them with or, not and.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.