Deck 11: Classes and Object-Oriented Programming

Full screen (f)
exit full mode
Question
Object-oriented programming allows us to hide the object's data attributes from code that is outside the object.
Use Space or
up arrow
down arrow
to flip the card.
Question
In a UML diagram, the middle section holds the list of the class's methods.
Question
What type of method provides a safe way for code outside a class to retrieve the values of attributes, without exposing the attributes in a way that they could be changed by the code outside the method?

A) Accessor
B) Mutator
C) Setter
D) Class
Question
A mutator method has no control over the way that a class's data attributes are modified.
Question
Which section in the UML holds the list of the class's data attributes?

A) first
B) Second
C) Third
D) fourth
Question
A(n) _____ is a set of real-world objects, parties, and major events related to the problem.

A) class
B) problem domain
C) object
D) instance
Question
Procedures operate on data items that are separate from the procedures.
Question
What are the procedures that an object performs called?

A) Methods
B) Actions
C) Modules
D) Instances
Question
What is, conceptually, a self-contained unit that consists of data attributes and methods that operate on the data attributes?

A) Class
B) Object
C) Instance
D) Module
Question
What type of programming contains class definitions?

A) Procedural
B) Object
C) Object-oriented
D) Modular
Question
What is another name for the accessor methods?

A) Setters
B) Getters
C) Instances
D) Attributes
Question
When a method is called, what does Python make to reference the specific object on which the method is supposed to operate?

A) state variable
B) self parameter
C) object data
D) init procedure
Question
What does the acronym UML stand for?

A) Unified Modeling Language
B) United Modeling Language
C) Unified Model Language
D) United Model Language
Question
The instances of a class share the data attributes in the class.
Question
Which method is automatically executed when an instance of the class is created in memory?

A) __state__
B) __obj__
C) __str__
D) __init__
Question
Which section in the UML holds the list of the class's methods?

A) first
B) Second
C) Third
D) fourth
Question
What is another name for the mutator methods?

A) Setters
B) Getters
C) Instances
D) Attributes
Question
What is the special name given to the method that returns a string containing the object's state?

A) __state__
B) __obj__
C) __str__
D) __init__
Question
What attributes belong to a specific instance of the class?

A) Instance
B) Self
C) Object
D) Data
Question
What is the combining of data and code in a single object known as?

A) Modularity
B) Instantiation
C) Encapsulation
D) Objectification
Question
An object's _______________ is simply the values of the object's attributes at any given moment.
Question
A(n) _______________ is code that specifies the data attributes and methods for a particular type of object.
Question
In _______________ programming, the programming is centered on objects that are created from abstract data types that encapsulate data and functions together.
Question
_______________ programming is a method of writing software that centers on the actions that take place in a program.
Question
The _______________ attributes are created by the self parameter and they belong to a specific instance of the class.
Question
A class definition is stored in the library so that it can be imported into any program.
Question
_______________ provides a set of standard diagrams for graphically depicting object-oriented systems.
Question
The self parameter is required in every method of a class.
Question
Each object that is created from a class is called a(n) _______________ of the class.
Question
An object is a stand-alone program but is used by programs that need its service.
Question
A class might be thought of as a 'blueprint' that an object may be created from.
Question
A method that returns a value from a class's attribute but does not change it is known as a(n) _______________ method.
Question
A class _______________ is a set of statements that define a class's methods and data attributes.
Question
The self parameter need not be named self, but it is strongly recommended to conform with standard practice.
Question
A(n) _______________ method in a class initializes an object's data attributes.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 11: Classes and Object-Oriented Programming
1
Object-oriented programming allows us to hide the object's data attributes from code that is outside the object.
True
2
In a UML diagram, the middle section holds the list of the class's methods.
False
3
What type of method provides a safe way for code outside a class to retrieve the values of attributes, without exposing the attributes in a way that they could be changed by the code outside the method?

A) Accessor
B) Mutator
C) Setter
D) Class
A
4
A mutator method has no control over the way that a class's data attributes are modified.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
5
Which section in the UML holds the list of the class's data attributes?

A) first
B) Second
C) Third
D) fourth
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
6
A(n) _____ is a set of real-world objects, parties, and major events related to the problem.

A) class
B) problem domain
C) object
D) instance
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
7
Procedures operate on data items that are separate from the procedures.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
8
What are the procedures that an object performs called?

A) Methods
B) Actions
C) Modules
D) Instances
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
9
What is, conceptually, a self-contained unit that consists of data attributes and methods that operate on the data attributes?

A) Class
B) Object
C) Instance
D) Module
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
10
What type of programming contains class definitions?

A) Procedural
B) Object
C) Object-oriented
D) Modular
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
11
What is another name for the accessor methods?

A) Setters
B) Getters
C) Instances
D) Attributes
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
12
When a method is called, what does Python make to reference the specific object on which the method is supposed to operate?

A) state variable
B) self parameter
C) object data
D) init procedure
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
13
What does the acronym UML stand for?

A) Unified Modeling Language
B) United Modeling Language
C) Unified Model Language
D) United Model Language
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
14
The instances of a class share the data attributes in the class.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
15
Which method is automatically executed when an instance of the class is created in memory?

A) __state__
B) __obj__
C) __str__
D) __init__
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
16
Which section in the UML holds the list of the class's methods?

A) first
B) Second
C) Third
D) fourth
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
17
What is another name for the mutator methods?

A) Setters
B) Getters
C) Instances
D) Attributes
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
18
What is the special name given to the method that returns a string containing the object's state?

A) __state__
B) __obj__
C) __str__
D) __init__
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
19
What attributes belong to a specific instance of the class?

A) Instance
B) Self
C) Object
D) Data
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
20
What is the combining of data and code in a single object known as?

A) Modularity
B) Instantiation
C) Encapsulation
D) Objectification
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
21
An object's _______________ is simply the values of the object's attributes at any given moment.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
22
A(n) _______________ is code that specifies the data attributes and methods for a particular type of object.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
23
In _______________ programming, the programming is centered on objects that are created from abstract data types that encapsulate data and functions together.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
24
_______________ programming is a method of writing software that centers on the actions that take place in a program.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
25
The _______________ attributes are created by the self parameter and they belong to a specific instance of the class.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
26
A class definition is stored in the library so that it can be imported into any program.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
27
_______________ provides a set of standard diagrams for graphically depicting object-oriented systems.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
28
The self parameter is required in every method of a class.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
29
Each object that is created from a class is called a(n) _______________ of the class.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
30
An object is a stand-alone program but is used by programs that need its service.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
31
A class might be thought of as a 'blueprint' that an object may be created from.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
32
A method that returns a value from a class's attribute but does not change it is known as a(n) _______________ method.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
33
A class _______________ is a set of statements that define a class's methods and data attributes.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
34
The self parameter need not be named self, but it is strongly recommended to conform with standard practice.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
35
A(n) _______________ method in a class initializes an object's data attributes.
Unlock Deck
Unlock for access to all 35 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 35 flashcards in this deck.