Question: For all the problems below, generate the Control Flow Graph ( CFG ) , calculate the Cyclomatic Complexity using all 3 methods ( M =

For all the problems below, generate the Control Flow Graph (CFG), calculate the Cyclomatic Complexity using all 3 methods (M=R+1, M=P+1, M=E-N+2P)Finds pairs of numbers (i,j) where i is even, j is odd, and their sum is greater than
a given number k. If the sum is equal to k, the program prints "Perfect match". If the sum
is less than k , the loop continues. [4 Points]
def find pairs(n, k):
for i in range(1, n+1):
for j in range((1, n+1):
if i %2==0 and j %2!=0:
sum_ij = i + j
if sum_ij > k:
\ Print pair and sum
print(f"Pair ({i},{j}) with sum {sum_ij}")
elif sum_ij == k:print("Perfect match") and identify the set of Independent Paths.
For all the problems below, generate the Control

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 Programming Questions!