You are on page 1of 1

Assignment-2

Q-1 Consider the following program segment:

1. int max (int i, int j, int k)

2. {

3.int max;

4.if (i>j) then

5.if (i>k) then

6..max=i;

7.else max=k;

8.else if (j > k)

9. max=j

10.else max=k

11.return (max);

12.}

a) Draw the control flow graph for this program segment

b) Determine the cyclomatic complexity for this program

c) Determine the independent paths

Q-2 Write the test cases for commission problem and explain .

Q-3 Consider a program for the determination of the nature of roots of a


quadratic equation. Its input is a triple of positive integers (say a, b, c) and
values in the interval [0,100]. The program output may be one of the
following: [Not a quadratic equation; Real roots; Imaginary roots; Equal
roots]. Design the boundary value test cases and robust test cases for the
program. roots]. Design the boundary value test cases and robust test cases
for the program.

You might also like