Similar questions 2 more →
Software Engineering

Answer & solution
Official answer: A
1. Treat each compound source-level condition as one decision: X has its first if, the while, and the final if, so complexity 4.
2. The shown Y graph has 8 vertices and 10 edges, giving E−N+2=4. Serial composition adds complexities minus 1, so Z=4+4−1=7. Thus A. Expanding the short-circuit AND into separate predicate nodes would increase X to 5 and Z to 8; the official answer uses source-statement predicate counting rather than that expanded control-flow model.