Determine the cyclomatic complexity, Software Engineering

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

Posted Date: 7/26/2013 4:02:20 AM | Location : United States







Related Discussions:- Determine the cyclomatic complexity, Assignment Help, Ask Question on Determine the cyclomatic complexity, Get Answer, Expert's Help, Determine the cyclomatic complexity Discussions

Write discussion on Determine the cyclomatic complexity
Your posts are moderated
Related Questions
QUESTION (a) Compare and contrast between Project logic evaluation (PLE), Networking and Scheduling (b) Discuss how the true cost of defects can often be higher than the ini

Elucidate elementary process. Software applications are a combination of various elementary processes. Various elementary processes come together to form an application. Ele

A function module can be called from a transaction screen outside an ABAP/4 program. Yes, a function module called from transaction screen.

Question: a) It has often been argued that Rapid Application Development results in small stand-alone systems running in isolation. Discuss. b) Rapid Application developmen

Software for Searching Online Retrieval Systems : Each of the major online systems has its own software which supports its activities oil a host computer. Many of these hosts h



What are the Problems of Prototyping  In some organisations, theprototyping isn't as successful as anticipated. A common problem with this approach is that people expect much

We discussed the importance of framing a problem in order to understand the problem better and be able to develop a solution more quickly and easily. In this homework, you are ask

Information engineering is a system  engineering approach which is used to describe architectures which enable a business to use data professionally. The intent of information eng