Exam 10: Object-Oriented Programming

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

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)

UML is a graphical programming language.

(True/False)
4.8/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)

Encapsulation provides a form of information hiding.

(True/False)
4.9/5
(43)

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)

Special Methods are defined with

(Multiple Choice)
4.8/5
(43)

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
close modal

Filters

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