Deck 12: Adding Functionality to Your Classes
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/50
العب
ملء الشاشة (f)
Deck 12: Adding Functionality to Your Classes
1
Static member ____ can only access static data members and other static member ____ of the class.
A) functions, functions
B) objects, variables
C) variables, functions
D) references, variables
A) functions, functions
B) objects, variables
C) variables, functions
D) references, variables
A
2
When overloading the insertion operator to process a Complex object, it s important to understand that you re overloading an operator in the ____ class.
A) istream
B) Complex
C) operator
D) ostream
A) istream
B) Complex
C) operator
D) ostream
D
3
The ____ of an identifier defines the portion of a program where the identifier can be accessed.
A) scope
B) reach
C) section
D) block
A) scope
B) reach
C) section
D) block
A
4
As each class is defined, it gets its own block of memory for its data members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
5
A nonmember function can access private class data members as a(n) ____.
A) operator
B) friend
C) static function
D) privileged function
A) operator
B) friend
C) static function
D) privileged function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
6
In this statement: double RoomDimension::TotalSqFootage = 0.0; TotalSqFootage is a(n) ____.
A) static variable
B) class
C) method
D) namespace
A) static variable
B) class
C) method
D) namespace
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
7
Conversion from a built-in type to a class type is made using a(n) ____ constructor.
A) object conversion
B) type conversion
C) copy
D) type exchange
A) object conversion
B) type conversion
C) copy
D) type exchange
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
8
The initial class used as the basis for the derived class is referred to as the subclass.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
9
An object s data member takes precedence over a global variable of the same name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
10
An implicit conversion occurs in C++ s operations.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
11
____ class variables are allocated memory locations independent of any object being instantiated.
A) Global
B) Extern
C) Static
D) Register
A) Global
B) Extern
C) Static
D) Register
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
12
A derived class object can be assigned to a base class object.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
13
Class member functions are global in the file where they re defined but can be called only for objects created from the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
14
Inheritance allows redefining how member functions of related classes operate based on the class object being referenced.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
15
Overloading the insertion ( >) operators for class use requires creating operator functions that use these symbols but have a parameter list that includes a class ____.
A) reference
B) object
C) data type
D) address
A) reference
B) object
C) data type
D) address
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
16
You cannot create static member functions in C++.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
17
The function used to overload the ostream insertion operator is referred to as a(n) ____.
A) user-defined function
B) static function
C) friend function
D) operator function
A) user-defined function
B) static function
C) friend function
D) operator function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
18
In multiple inheritance, a derived type has two or more base types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
19
With the introduction of user-defined data types, there are ____ possibilities for conversion between data types.
A) two
B) three
C) four
D) eight
A) two
B) three
C) four
D) eight
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
20
Converting from a class to a class is done in the same manner as a conversion from a class to a built-in data type.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
21
Assigning a floating-point value to an integer variable is an example of a(n) ____ conversion.
A) implicit
B) functional
C) operation
D) explicit
A) implicit
B) functional
C) operation
D) explicit
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
22
Basing function selection on the object making the call is the classic definition of ____ behavior.
A) inherited
B) object-oriented
C) instantiated
D) polymorphic
A) inherited
B) object-oriented
C) instantiated
D) polymorphic
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
23
Setting up a conversion makes sense only when there s a(n) ____ relationship between data types.
A) meaningful
B) inverse
C) virtual
D) inherited
A) meaningful
B) inverse
C) virtual
D) inherited
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
24
A conversion operator function uses the name of a(n) ____.
A) member function
B) instance variable
C) built-in data type
D) object
A) member function
B) instance variable
C) built-in data type
D) object
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
25
The cout stream object s insertion operator function can be ____________________ to process user-defined class objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
26
One step in modifying cin to handle the Complex class is to provide access to the Complex class data. This is achieved by declaring the extraction operator function as a(n) ____________________ in the Complex class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
27
If a base class member has a protected access and the derived class s access specifier is public , the derived class member is ____ to its class.
A) public
B) global
C) protected
D) private
A) public
B) global
C) protected
D) private
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
28
When a derived class object is assigned to a base class object, only the set of all the ____ class data members is assigned.
A) base
B) instantiated
C) private
D) derived
A) base
B) instantiated
C) private
D) derived
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
29
Including a declaration for the second class before the first class s definition is formally called a(n) ____.
A) prior declaration
B) forward declaration
C) namespace declaration
D) including declaration
A) prior declaration
B) forward declaration
C) namespace declaration
D) including declaration
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
30
A built-in to built-in conversion is handled by C++ s implicit conversion rules or its explicit ___________________ operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
31
Casting from a base to a derived class requires a(n) ____ to initialize the derived class members that aren t in the base class.
A) destructor
B) mutator
C) operator
D) constructor
A) destructor
B) mutator
C) operator
D) constructor
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
32
Dynamic binding determines which function should be called at runtime, based on the ____ type making the call.
A) object
B) class
C) function
D) operator
A) object
B) class
C) function
D) operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
33
____ is the capability of deriving one class from another class.
A) Overloading
B) Redefinition
C) Polymorphism
D) Inheritance
A) Overloading
B) Redefinition
C) Polymorphism
D) Inheritance
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
34
A ____ function tells the compiler to create a pointer to a function but not fill in the pointer s value until the function is actually called.
A) bound
B) virtual
C) pointer
D) member
A) bound
B) virtual
C) pointer
D) member
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
35
All ____ data members come into existence before any objects are created.
A) public
B) static
C) virtual
D) local
A) public
B) static
C) virtual
D) local
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
36
Because a(n) ____________________ function can be called explicitly after all objects have been declared, it can be used as a cast independent of its initialization purpose.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
37
Overriding a base member function by using an overloaded derived member function is an example of ____.
A) inheritance
B) scoping
C) polymorphism
D) derivation
A) inheritance
B) scoping
C) polymorphism
D) derivation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
38
In a(n) ____ language, data and operations can be incorporated together in such a way that data values can be isolated and accessed through the specified class functions, but inheritance is not required.
A) class
B) object-based
C) object-bound
D) class-bound
A) class
B) object-based
C) object-bound
D) class-bound
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
39
Conversion from a class type to a built-in type is made by using a ____ function.
A) copy operator
B) reference
C) type constructor
D) conversion operator
A) copy operator
B) reference
C) type constructor
D) conversion operator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
40
In the assignment b = a; where a is a user-defined data type and b is a built in type, the conversion to the built in type is ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
41
In class to class conversion, including a conversion operator function with the second class s name in the first class creates a problem if the second class hasn t been ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
42
The feature of object-oriented languages called ____________________ allows redefining how member functions of related classes operate, based on the object being referenced.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
43
There are two categories of scope: local and ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
44
Class data members are ____________________ in scope to objects created from the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
45
____________________ access permits access only to member or friend functions, and allows any derived class to inherit this restriction.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
46
In the absence of a derived class constructor, the compiler automatically calls the default ____________________ class constructor first.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
47
C++ requires declaring static variables in the class ____________________ section.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
48
In normal function calls, ____________________ binding is used, meaning the determination of which function is called is made at compile time.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
49
The first line of the declaration section of a derived class must include an access specifier and a(n) ____________________ class name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck
50
A static variable with ____________________ access may be assigned a value or altered by a member function anywhere after the static variable s definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 50 في هذه المجموعة.
فتح الحزمة
k this deck