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 structured programming explain, Q. What is structured programming a...

Q. What is structured programming and why is it important? Ans. Structured programming is a term that was coined in the late 1960's to mean programming without using go to st

What is control chart, What is Control Chart? Ans) A statistical method ...

What is Control Chart? Ans) A statistical method for distinguishing among common and special cause variation exhibited by processes.

The worker pool multi-threading architecture, QUESTION (a) Compare the ...

QUESTION (a) Compare the worker pool multi-threading architecture with the thread-per-request architecture. (b) What thread operations are the most significant in cost? (

Timeline chart, how to make timeline chart for timetable generation system

how to make timeline chart for timetable generation system

Data Flow Diagram, I need help creating a DFD for an assignment. Is there a...

I need help creating a DFD for an assignment. Is there anyway you could help?

What is software fault, Software faults are unseen programming errors. Soft...

Software faults are unseen programming errors. Software faults are errors in the correctness of the semantics of computer programs.

No , Hard drive has space, but it keeps telling me that its full and asks m...

Hard drive has space, but it keeps telling me that its full and asks me to delete files. I checked. There is nearly full C drives (8GB) but when i am open c drive and check than ne

Define a software process, Define a software process. How do software myths...

Define a software process. How do software myths affect a software process? Software process is a Coherent set of activities for specifying, designing, executing and testing so

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