Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started