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
detail the proactive strategies of risk management

what is driven development?give example what benifit of driven development


Q. Describe about Unit Testing? Unit Testing: The unit testing is completed to test the individual module of the software. Test cases are designed to test the program functiona

Static testing and dynamic testing Static testing is checking the application without actually running the application while dynamic testing checks the application by running i

Explain the persistent class maps to one relational table In most of cases, persistent class maps to one relational table (keeping aside inheritance issue, for the moment). In

What is a user interface Ans) "User interface" is the interface among a human user and a computer system. It access the passage of information among a human user and hardware or

Describe the advantages of proper inheritance. The biggest advantages of proper inheritance are:  a.) substitutability and b.) extensibility.

Decision-making is the activity of deciding appropriate action in given situations. Having useful information helps to reduce the uncertainty in decision-making. Information is

Illustrate the Introduction to Flowcharts This mainly covers four areas: 1 Common flow chart symbols 2 Writing flowcharts to solve problems 3 Dry running of flowcharts