Exam 10: Object-Oriented Programming  

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following statements is false?

Free
(Multiple Choice)
4.7/5
(36)
Correct Answer:
Verified

D

Which of the following statements a), b) or c) is false?

Free
(Multiple Choice)
4.7/5
(42)
Correct Answer:
Verified

A

Which of the following statements a), b) or c) is false?

Free
(Multiple Choice)
4.8/5
(38)
Correct Answer:
Verified

B

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(30)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(32)

Properties look like ________ to client-code programmers, but control the manner in which they get and modify an object's data.

(Multiple Choice)
4.9/5
(37)

Which of the following statements is false?

(Multiple Choice)
4.8/5
(38)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(30)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.7/5
(38)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(30)

The following code and traceback shows that our class Time's hour property xe "validate data"validates the values you assign to it: In [10]: wake_up.hour = 100 --------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-10-1fce0716ef14> in <module>() ----> 1 wake_up.hour = 100 ~/Documents/examples/ch10/timewithproperties.py in hour(self, hour) 20 """Set the hour.""" 21 if not (0 <= hour < 24): ---> 22 raise ValueError(f'Hour ({hour}) must be 0-23') 23 24 self._hour = hour ValueError: Hour (100) must be 0-23 Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.7/5
(34)

Most object-oriented programming languages enable you to encapsulate (or hide) an object's data from the client code. Such data in these languages is said to be ________ data.

(Multiple Choice)
4.8/5
(39)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.7/5
(32)

Assume that class Time's __init__ method receives hour, minute and second parameters. Based on the following code: wake_up = Time(hour=6, minute=30) Which of the following statements is true?

(Multiple Choice)
4.8/5
(42)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(32)

Which of the following statements is false?

(Multiple Choice)
4.9/5
(38)

Which of the following statements a), b) or c) is false?

(Multiple Choice)
4.8/5
(38)

Properties are implemented as ________, so they may contain additional logic, such as specifying the format in which to return a data attribute's value or validating a new value before using it to modify a data attribute.

(Multiple Choice)
4.8/5
(45)

Which of the following statements about code snippets that use class Account is false?

(Multiple Choice)
4.8/5
(40)

When you evaluate a variable in IPython it calls the corresponding object's ________ special method to produce a string representation of the object.

(Multiple Choice)
4.8/5
(29)
Showing 1 - 20 of 42
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)