Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Read the following Java code fragment for a method which attempts to calculate the number of students having the mark between 1 and 4. ns

Read the following Java code fragment for a method which attempts to calculate the number of students having the mark between 1 and 4.

ns = 0;

I = 0;

while (I <= N) {

if (mark[I] >= 1.0 && mark[I] < 4.0)

ns++;

I++;

}

print ns;

(i) Draw a control flow graph.

(ii) Based on the control flow graph, find the cyclomatic complexity and list all the (linearly) independent paths.

(iii) Prepare a test case for each independent path.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+ 3. What are demand deposits and why should

Answered: 1 week ago