Deck 11: Introduction to Classes
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/50
Play
Full screen (f)
Deck 11: Introduction to Classes
1
Constructors are considered to be mutator functions.
False
2
C++ constructors cannot be written as inline functions.
False
3
In C++, an object may be declared with empty parentheses.
False
4
In C++, class names must always start with a capital letter.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
5
Languages that use classes but don t provide inheritance and polymorphism are referred to as ____ languages.
A) object-based
B) object-oriented
C) object-supported
D) object-complying
A) object-based
B) object-oriented
C) object-supported
D) object-complying
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
6
In computer terminology, the combination of data and associated operations is defined as a(n) ____.
A) constant type
B) external type
C) data type
D) variable type
A) constant type
B) external type
C) data type
D) variable type
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
7
The class declaration section begins with the keyword ____ followed by a class name.
A) instance
B) typedef
C) create
D) class
A) instance
B) typedef
C) create
D) class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
8
In C++, a common programming error consists of including a return type with the constructor s prototype.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
9
When constructing a class in C++, the ____ section declares both the data types and functions for the class.
A) declaration
B) implementation
C) definition
D) data
A) declaration
B) implementation
C) definition
D) data
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
10
Like constructors, there can be more than one destructor function per class.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
11
The C language, which is C++ s predecessor, is a(n) ____ language.
A) hybrid
B) procedural
C) object-oriented
D) relational
A) hybrid
B) procedural
C) object-oriented
D) relational
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
12
The first requirement of a pure object-oriented language is that it contain three specific features: classes, inheritance, and ____.
A) virtual functions
B) constants
C) variables
D) polymorphism
A) virtual functions
B) constants
C) variables
D) polymorphism
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
13
Central to the creation of objects is the concept of a(n) ____ data type.
A) contained
B) included
C) abstract
D) concrete
A) contained
B) included
C) abstract
D) concrete
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
14
A(n) ____ is simply a user-defined type that defines both a type of data and the operations that can be performed on it.
A) built-in data type
B) abstract data type
C) internal data type
D) external data type
A) built-in data type
B) abstract data type
C) internal data type
D) external data type
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
15
In C++, an abstract data type is referred to as a(n) ____.
A) object
B) method
C) attribute
D) class
A) object
B) method
C) attribute
D) class
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
16
In C++, using the same name for a data member as for a member function does not produce an error.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
17
Both the variables and functions listed in the class declaration section are collectively referred to as ____.
A) class methods
B) class attributes
C) class members
D) class instance variables
A) class methods
B) class attributes
C) class members
D) class instance variables
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
18
Just as a variable of an integer type must be defined, variables of a user-declared class must also be defined.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
19
C++ is an example of a pure object-oriented programming language.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
20
User-defined data types are required when you want to create objects that are more complex than simple integers and characters.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
21
A common programming error consists of failing to terminate the class declaration section with a ____ character.
A) ;
B) .
C) }
D) ::
A) ;
B) .
C) }
D) ::
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
22
Objects are referred to as ____ of a class.
A) state
B) members
C) built-in types
D) instances
A) state
B) members
C) built-in types
D) instances
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
23
How you choose to store data in a user-defined abstract data type is called its data ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
24
The ____ keyword specifies that the class members following it can be accessed only by using the class functions.
A) private
B) public
C) protected
D) restricted
A) private
B) public
C) protected
D) restricted
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
25
The term ____ refers to packaging a number of items into a single unit.
A) modular
B) encapsulation
C) interface
D) compression
A) modular
B) encapsulation
C) interface
D) compression
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
26
Unlike a procedural approach, a(n) ___________________ approach fits graphically windowed environments well.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
27
A(n) ____ is any nonconstructor class method that changes an object s data values.
A) access method
B) mutator method
C) get function
D) return function
A) access method
B) mutator method
C) get function
D) return function
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
28
In a pure object-oriented language, all data types are constructed as ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
29
A ____ function is any function that has the same name as its class.
A) constructor
B) definer
C) destructor
D) creator
A) constructor
B) definer
C) destructor
D) creator
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
30
Variables defined to be of a user-declared class are referred to as ____.
A) attributes
B) member variables
C) objects
D) instance variables
A) attributes
B) member variables
C) objects
D) instance variables
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
31
By definition, a(n) ____________________ is simply a user-defined type that defines both a type of data and the operations that can be performed on it.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
32
The type of access that restricts a user from seeing how data is actually stored is referred to as ____.
A) source scrambling
B) data hiding
C) limited view
D) class hiding
A) source scrambling
B) data hiding
C) limited view
D) class hiding
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
33
The term encapsulation is sometimes used to refer to the process of ____.
A) class implementation
B) object instantiation
C) data hiding
D) class construction
A) class implementation
B) object instantiation
C) data hiding
D) class construction
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
34
The values contained in an object s data members determine the object s ____.
A) category
B) class
C) state
D) scope
A) category
B) class
C) state
D) scope
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
35
The term ____ refers to any constructor that does not require any arguments when it is called.
A) main constructor
B) default constructor
C) user-defined constructor
D) empty constructor
A) main constructor
B) default constructor
C) user-defined constructor
D) empty constructor
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
36
____ are functions with the same class name as constructors but preceded with a tilde (~).
A) Destructors
B) Collectors
C) Removers
D) Destroyers
A) Destructors
B) Collectors
C) Removers
D) Destroyers
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
37
The ____ section of a class is where the member functions declared in the declaration section are written.
A) declaration
B) body
C) definition
D) implementation
A) declaration
B) body
C) definition
D) implementation
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
38
A(n) ____ is any non-constructor member function that accesses a class s private data members.
A) set function
B) private function
C) member method
D) accessor function
A) set function
B) private function
C) member method
D) accessor function
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
39
A(n) ____ consists of a class s public member function declarations and any supporting comments.
A) implementation
B) interface
C) class scope
D) object
A) implementation
B) interface
C) class scope
D) object
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
40
The default membership category in a class is ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
41
Multiple constructors can be defined for each class as long as each one has a different number of and/or different ____________________ types.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
42
The ____________________ function has no return type.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
43
Defining more than one ____________________ constructor for a class is a common programming error.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
44
A class s ____________________ defines the operations permitted to be performed on an object s data members.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
45
A(n) ____________________ function is called automatically when an object goes out of existence.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
46
In UML diagrams, ____________________ have two qualities: type and visibility.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
47
In UML, class diagrams are used to describe classes and their ____________________.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
48
An object name and a data member name separated by the ____________________ operator is the standard syntax for referring to an object s data member.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
49
The process of creating a new object is often referred to as a(n) ____________________ of the object.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck
50
The terms class method and class ____________________ are used interchangeably in C++.
Unlock Deck
Unlock for access to all 50 flashcards in this deck.
Unlock Deck
k this deck