logo

Crowdly

What is the cyclomatic complexity of the following code? def calculate_discount...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What is

the cyclomatic complexity of the following code?

def calculate_discount(price, is_member, season):

   discount = 0

   if price > 100:

      if is_member:

         if season == ‘summer’:

            discount = 0.2

         else:

            discount = 0.1

      else:

         if season == ‘winter:

            discount = 0.15

         else:

            discount = 0.05

   return price * (1 – discount)

0%
0%
0%
0%
0%
0%
100%
More questions like this

Want instant access to all verified answers on moodle.conncoll.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!