22.11.2012 Views

Schaum's Outline Series

Schaum's Outline Series

Schaum's Outline Series

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

142<br />

1. A person tries to turn the door handles. Environment Visible<br />

2. The door is unlocked by the system. System Visible<br />

3. An employee lets a nonemployee through the door. Environment Hidden<br />

4. An employee has an identical twin. Environment Hidden<br />

5. An image has the minimal number of similarities for the matching algorithm. System<br />

Hidden<br />

Answers to Problems<br />

1. Draw scenarios for the interaction between a customer trying to buy a particular music<br />

CD with cash and a clerk in the music store. Be sure to cover all possibilities. Use the<br />

state machine model with the events being the arcs.<br />

See Fig. 9-9.<br />

Customer<br />

enters store<br />

Customer<br />

doesn’t<br />

find CD<br />

Customer<br />

leaves store<br />

2. Calculate Bieman and Ott’s functional cohesion metrics for the following code segment.<br />

Draw a directed graph and show the flows.<br />

cin >> a >> b;<br />

int x,y,z;<br />

x=0; y=1; z=1;<br />

while (a > 0){<br />

x=x+b;<br />

z=z*b;<br />

if (a > b){<br />

y=y*a;<br />

}<br />

a=a-1;<br />

}<br />

cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!