Bird
0
0

Consider this simplified code snippet representing phases in a software process model:

medium📝 Analysis Q13 of 15
Software Engineering - Fundamentals
Consider this simplified code snippet representing phases in a software process model:
phases = ['Requirements', 'Design', 'Implementation', 'Testing']
for i in range(len(phases)):
    print(phases[i])
    if i == 2:
        print('Review before Testing')

What will be the output?
ARequirements Design Implementation Testing Review before Testing
BReview before Testing Requirements Design Implementation Testing
CRequirements Design Review before Testing Implementation Testing
DRequirements Design Implementation Review before Testing Testing
Step-by-Step Solution
Solution:
  1. Step 1: Understand the loop and conditions

    The loop prints each phase in order. When index i is 2 (third item), it prints 'Review before Testing' before continuing.
  2. Step 2: Trace the output line by line

    Prints 'Requirements', 'Design', 'Implementation', then 'Review before Testing', then 'Testing'.
  3. Final Answer:

    Requirements Design Implementation Review before Testing Testing -> Option D
  4. Quick Check:

    Print phases in order + review at i=2 [OK]
Quick Trick: Print phases; add review after Implementation (index 2) [OK]
Common Mistakes:
  • Printing review after Testing instead of before
  • Mixing order of phases
  • Misunderstanding loop index

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Software Engineering Quizzes