Determine the cyclomatic complexity, Software Engineering

Assignment Help:

Q. Consider the program given below

void main()

{

int i,j,k;

readln (i,j,k);

if( (i < j) || ( i > k) )

{

writeln("then part");

if (j < k)

writeln ("j less then k");

else writeln ( " j not less then k");

}

else writeln( "else Part"); }

(i) Draw the flow graph. (4)

(ii) Determine the cyclomatic complexity. (4)

(iii) Arrive at all the independent paths. (8)

 

 

Ans:

void main()

{

int i,j,k;

readln (i,j,k);

if( (i < j) || ( i > k) )

{

writeln("then part");

if (j < k)

writeln ("j less then k");

else writeln ( " j not less then k");

}

else writeln( "else Part");

}

206_Determine the cyclomatic complexity.png

(ii) Cyclomatic complexity = E - N + 2 = 12 - 10 + 2 = 4

(iii) The four independent paths are

Path1 : 1 2 3 9 10

Path2 : 1 2 4 5 7 8 10

Path3 : 1 2 4 5 6 8 10

Path4 : 1 2 3 4 5 7 8 10


Related Discussions:- Determine the cyclomatic complexity

What is a user friendly document, What is a user friendly document? Ans)...

What is a user friendly document? Ans) A document is user friendly, when it is designed and written with simple of use, as single of the primary objectives of its design.

State the categories of software maintenance, Categories of software mainte...

Categories of software maintenance There are three categories of maintenance:  i) Corrective Maintenance ii) Adaptive Maintenance iii) Perfective Maintenance

What is a state transition diagram, What is a state transition diagram? ...

What is a state transition diagram? State transition diagram is basically a collection of states and events. The events cause the system to change its state. It also show what

Code restructuring, Ask quewhat is code restructuringstion #Minimum 100 wor...

Ask quewhat is code restructuringstion #Minimum 100 words accepted#

Explain spiral model, Explain Spiral model The spiral model is separ...

Explain Spiral model The spiral model is separated into number of frame works. These frameworks are indicated by task regions. Usually there are six task regions. In spir

Explain special value testing, Special Value Testing: It is the form of fu...

Special Value Testing: It is the form of functional testing. Special value testing happens when a tester uses his or her domain knowledge, experience with same program and informa

What is a vertical microinstruction, What is a vertical microinstruction? ...

What is a vertical microinstruction? Ans) A vertical microinstruction is a microinstruction that states one of a sequence of operations required to carry out a machine language

Describe the types of structure charts, Q. Describe the Types of Structure ...

Q. Describe the Types of Structure Charts? Transaction structure it control module calls subordinate modules each of which handles a particular transaction Many afferent

List any characteristics of a good srs, List any three characteristics of a...

List any three characteristics of a good SRS. Ans:The SRS should be: Correct , Unambiguous, Complete 1. Correct: An SRS is correct if each requirement stated therein is on

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd