Exam 10: Object-Oriented Programming
Exam 1: Introduction102 Questions
Exam 2: Data and Expressions71 Questions
Exam 3: Control Structures129 Questions
Exam 4: Lists85 Questions
Exam 5: Functions83 Questions
Exam 6: Objects and Their Use54 Questions
Exam 7: Modular Design62 Questions
Exam 8: Text Files58 Questions
Exam 9: Dictionaries and Sets33 Questions
Exam 10: Object-Oriented Programming81 Questions
Exam 11: Recursion27 Questions
Select questions type
For an XYCoord class that stores x and y private instance variables, how should the variables be named?
(Essay)
4.8/5
(45)
A class diagram in UML is used to specify the static aspects of an object-oriented design.
(True/False)
4.9/5
(40)
Give the definition of an abstract class named Currency that stores a currency amount (as an integer value). Include in the class an __init__ method and an abstract __str__ method. Define three subclasses of the Currency class named USCurrency (dollars), EuroCurrency (euros), and the ChineseCurrency (yuan). Implement the __str__ method of each so that the proper currency symbol is displayed. The Unicode string for displaying Euro and Chinese currency symbols are '\u20AC' and '\u5143, respectively.
(Essay)
4.8/5
(46)
Functions in Python meant to serve as methods of a particular class must have an added first parameter, by convention named ___________.
(Short Answer)
4.8/5
(40)
Another name for a subclass is a _____________ class or _____________ class.
(Short Answer)
4.7/5
(38)
_______________ in a UML class diagrams is used to indicate the number of objects that may be associated with an object of another type.
(Short Answer)
4.8/5
(36)
Built-in function _______ can be used to determine the type (class name) of any value in Python.
(Short Answer)
4.9/5
(34)
Built-in function _______ can be used to get the class description of a built-in type in Python.
(Short Answer)
4.8/5
(44)
Functions serving as methods of a given class must have an extra first parameter, which by convention is named self.
(True/False)
4.9/5
(34)
in Python, any set of classes with a common set of methods, even if not subclasses of a common type, can be treated similarly. This kind of typing is called ___________________.
(Short Answer)
4.8/5
(40)
The most common relationship between classes is a UML class diagram is association.
(True/False)
4.7/5
(35)
The direction of method calls between two classes can be optionally specified in UML by the use of ______________.
(Short Answer)
4.8/5
(38)
Match the descriptions with their terms:
-describes an association between two classes
(Multiple Choice)
4.8/5
(33)
Private members of a class in Python must begin with two ________________ characters.
(Short Answer)
4.8/5
(34)
Initialization methods like __init__ in Python are named ______________ in UML.
(Short Answer)
4.7/5
(44)
The + and - symbols in UML class diagrams are used to denote
(Multiple Choice)
4.9/5
(32)
Another name for a superclass is a _____________ class or _____________ class.
(Short Answer)
4.7/5
(33)
Showing 41 - 60 of 81
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)