logo

Crowdly

Browser

Додати до Chrome

البرمجة الكينونية (CS 210) تجميع

Шукаєте відповіді та рішення тестів для البرمجة الكينونية (CS 210) تجميع? Перегляньте нашу велику колекцію перевірених відповідей для البرمجة الكينونية (CS 210) تجميع в elearning.yu.edu.jo.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

The output of the following code:

class ABC:

  def __init__(self):

    self.x = 2

    self.y = 4

  def __mul__(self, other):

    tmp = ABC()

    tmp.x = self.x + other.y

    return tmp

     

a1 = ABC()

a2 = ABC()

a3 = a1 * a2

print(str(a3.x)) 

is? 

0%
0%
0%
0%
Переглянути це питання

The output of the following code:

class ABC:

  def __init__(self):

    self.x = 2

    self.y = 4

  def __mul__(self, other):

    tmp = ABC()

    tmp.x = self.x + other.y

    return tmp

    

  

a1 = ABC()

a2 = ABC()

a1 = a1 * a2

print(a1.y)  

is? 

Переглянути це питання

The following code has a logical error:

1) class ABC:

2)   def __init__(self):

3)      self.x = 2

4)   def __truediv__(self, other):

5)      tmp = ABC()

6)      tmp.x = self.x / other.x

7)      return self

  

8)   a1 = ABC()

9)   a2 = ABC()

10) a1 = a1 / a2

11) print(a1.x)  

Which line has the logical error so that once fixed the overloading will work correctly?

0%
0%
0%
0%
Переглянути це питання

To overload an operator for example "*" in all classes you need to implement its method in one class only? 

0%
0%
Переглянути це питання

The following code:

class Rectangle:

# code for this class 

def __add__(self , x):

        r3 = Rectangle()

        r3.l = self.l + x.l

        r3.w = self.w + x.w

        return r3

Will overload the following operator? 

Переглянути це питання

What happens when this code runs?

Переглянути це питання
What will print(Student.name) output?

0%
0%
0%
0%
Переглянути це питання

What is the output of this code, if any?

Переглянути це питання

What is the output of the following code?

Переглянути це питання

What is the output of the following?

Переглянути це питання

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

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

Browser

Додати до Chrome