Question: a) For the following control flow graph, calculate the cyclomatic complexity. Show your work. b) For the following program P2, calculate the cyclomatic complexity. Show

a) For the following control flow graph, calculate the cyclomatic complexity. Show your work.

b) For the following program P2, calculate the cyclomatic complexity. Show your work.

Program P2

1) integer A, B; 

2) input (A);

3)

4) if (A > 7)

5) { 6) B =1; 7) } 8) else 9) { 10) B = 2; 11) if (A 7

14) 15) while (i=1; i

16) { 17) if (B

25) } // end loop 26) 27) output (A,B); 28) end;

Start true false true 3 false 5 false true true alse End

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!