CS FundamentalsModerateCognizant · Capgemini pattern
A sequence diagram shows a loop combined fragment labelled `loop [for each item in cart]` wrapping a single message `validateItem(item)` sent from Checkout to Validator. What does this fragment mean?
- A. validateItem(item) is sent exactly once, and 'loop' is purely a comment
- B. The entire sequence diagram repeats, including messages outside the fragment
- C. Loop fragments are not valid inside sequence diagrams
- D. The validateItem(item) message is sent once per item in the cart, repeating for the guard's iteration condition, not just once
Correct answer: D. The validateItem(item) message is sent once per item in the cart, repeating for the guard's iteration condition, not just once
A loop combined fragment repeats its enclosed interaction for each iteration described by its guard; here Checkout calls validateItem once per cart item, not once overall.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A class diagram shows Vehicle as a superclass with a generalization (hollow triangle arrow) pointing from Car and Truck up to Vehicle. If…
- Using basic COCOMO for a semi-detached project (E = 3 × KLOC^1.12 person-months), what is the estimated effort for a 45 KLOC project?
- A control flow graph has 28 edges and 20 nodes. What is its cyclomatic complexity?
- A control flow graph has 30 edges and 21 nodes, forming 2 disconnected components. What is its cyclomatic complexity?
- A control flow graph has 7 edges and 6 nodes. What is its cyclomatic complexity?
- A control flow graph has 31 edges and 22 nodes. What is its cyclomatic complexity?