logo

Crowdly

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

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

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%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.conncoll.edu?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!