条件表达式的可读性与简化 — 软件工程选择题
题目
某审核模块的原始条件为:if (!(age < 18 || isStudent == false || !(hasID))) { approve(); }。将其改写为等价但最简、最可读的条件,正确的是:
A. if (age >= 18 && isStudent && hasID) { approve(); }
B. if (age >= 18 || isStudent && hasID) { approve(); }
C. if (age >= 18 && isStudent == true && !hasID == false) { approve(); }
D. if (!(age >= 18 && isStudent && hasID)) { approve(); }