Question: Q 1 :Draw the Control Flow graph for the following and calculate cyclomatic complexity for the following code snippet: int func 1 ( int x

Q1:Draw the Control Flow graph for the following and calculate cyclomatic complexity for the following code snippet:
int func1(int x, int y)
1
While (xy){
If (x>y) then
x=x-y;
else y=y-x;
}
return x;
}
Q2
1 READ A
2 READ B
3 Sum = A+ B
Provide the Test cases for 100% Statement coverage. For this convert given pseudocode to flow chart and then show how many
test cases are required for 100% statement coverage.
Q3:
IF Age >16
Process License application
3 ELSE
4 Decline the License application process
5 END IF
Provide the Test cases for 100% Statement and Decision coverage. For this convert given pseudocode to flow chart and then
show how many test cases are required for 100% statement and Decision coverage.
Q4:
Nested Ifs or multiple IFs within an IF:
1 IF ( Age >17)
2 IF Age 50
3 Print Age is between 17 and 50
4 ELSE IF (Age >50)
5 Print Age is greater than 50
6 END IF
7 ELSE
8 Print Age is less than 17.
9 END IF
Provide test cases which are needed for 100% Statement and Decision test coverage?For this firstly, convert given
pseudocode to flow chart and then show how many test cases are required for 100% statement and Decision coverage.
Q5:
Provide test cases which are required to achieve 100% Statement coverage ? For this firstly, convert given pseudocode to
flow chart and then show how many test cases are required for 100% statement coverage.
Print sum (int a, int b)
{
int result =a+b;
if (result >0)
print ("red", result)
else if (result 0)
print ("blue", result)
}
 Q1:Draw the Control Flow graph for the following and calculate cyclomatic

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!