bool
else
break
switch
if
safeLimit
0.9 * safeLimit
INVALID: bad measurement
TRIP: disconnect supply
WARNING: near limit
NORMAL
The trip test is current > safeLimit, and 10 is not greater than 10 — so the reading falls through to the warning band above 9. An exact boundary belongs to whichever branch uses >=.
current > safeLimit
>=
Setup The branch code says "trust me."
Punchline The table says: show me every row you intend to handle.
char command
double reading
int menuChoice
A switch compares one discrete value against constant cases, so it accepts integral and enumeration types. A measurement belongs in a branch chain that tests ranges.
!= 0.0
resistance > minimumResistance && voltage / resistance > limit
&&
Short-circuiting is what makes the guard work: the left test decides the result on its own, so the division is never reached. Order the operands accordingly — the guard has to come first.
Setup Every visitor wants to use the "normal" door.
Punchline Emergency first, special cases next, ordinary traffic waits its turn.
d
Setup The panel has three honest buttons and one confused ramp of values.
Punchline Buttons like named choices; a ramp needs a range check instead.