Deck 8: Class Features and Design Issues
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
Match between columns
سؤال
سؤال
Match between columns
سؤال
سؤال
Match between columns
سؤال
Match between columns
سؤال
Match between columns
سؤال
Match between columns
سؤال
Match between columns
سؤال
Match between columns
سؤال
Match between columns
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/53
العب
ملء الشاشة (f)
Deck 8: Class Features and Design Issues
1
____ functions perform some action or service, such as sorting data or searching for data.
A) Inspector
B) Predicate
C) Mutator
D) Auxiliary
A) Inspector
B) Predicate
C) Mutator
D) Auxiliary
D
2
____ functions return information about an object's state, or display some or all of an object's attributes.
A) Inspector
B) Manager
C) Mutator
D) Auxiliary
A) Inspector
B) Manager
C) Mutator
D) Auxiliary
A
3
The one's complement operator (____) is the operator that makes every bit become its opposite.
A) !
B) ^
C) ~
D) %
A) !
B) ^
C) ~
D) %
C
4
isUpper() is a typical example of a(n) ____ function.
A) manager
B) auxiliary
C) inspector
D) predicate
A) manager
B) auxiliary
C) inspector
D) predicate
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
5
getName() is a typical example of a(n) ____ function.
A) manager
B) auxiliary
C) inspector
D) predicate
A) manager
B) auxiliary
C) inspector
D) predicate
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
6
____ functions change an object's state or attributes.
A) Inspector
B) Manager
C) Mutator
D) Auxiliary
A) Inspector
B) Manager
C) Mutator
D) Auxiliary
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
7
A ____ is a collection of useful classes.
A) library
B) superclass
C) class hierarchy
D) module
A) library
B) superclass
C) class hierarchy
D) module
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
8
A ____ function has the same name as its class, preceded with a tilde.
A) constructor
B) manager
C) predicate
D) destructor
A) constructor
B) manager
C) predicate
D) destructor
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
9
An initialization list is the part of the constructor header to the left of the colon.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
10
The one's complement operator is also called the bitwise complement operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
11
A ____ constructor makes a local copy.
A) default
B) non-default
C) copy
D) bitwise
A) default
B) non-default
C) copy
D) bitwise
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
12
The composition relationship is called an "is-a" relationship.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
13
A ____ function has the same name as its class.
A) constructor
B) manager
C) predicate
D) mutator
A) constructor
B) manager
C) predicate
D) mutator
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
14
A(n) ____ is an internal name for the group of statements that make up the definition of a class.
A) #ifndef name
B) #define name
C) #ifdef name
D) #include name
A) #ifndef name
B) #define name
C) #ifdef name
D) #include name
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
15
Several destructors can exist for each class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
16
sortAscending() is a typical example of a(n) ____ function.
A) manager
B) auxiliary
C) inspector
D) predicate
A) manager
B) auxiliary
C) inspector
D) predicate
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
17
Coupling is either tight coupling or loose coupling, depending on how much one function depends on information from another.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
18
____ functions create and destroy objects for you.
A) Constructor
B) Manager
C) Mutator
D) Auxiliary
A) Constructor
B) Manager
C) Mutator
D) Auxiliary
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
19
All constructors are public.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
20
____ functions test the truth of some condition.
A) Inspector
B) Predicate
C) Mutator
D) Auxiliary
A) Inspector
B) Predicate
C) Mutator
D) Auxiliary
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
21
If you want to create an array of class objects such as House aHouse[3] , the class must have a default ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
22
What does it mean to overload a constructor?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
23
A(n) ____________________ constructor is one that does not require any arguments.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
24
How do constructor functions differ from other member functions?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
25
____ refers to how well the operations in a function relate to one another.
A) Encapsulation
B) Abstraction
C) Cohesion
D) Coupling
A) Encapsulation
B) Abstraction
C) Cohesion
D) Coupling
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
26
The ____ directive means that you have reached the end of the block of code that you are defining.
A) #define
B) #endif
C) #ifdef
D) #ifndef
A) #define
B) #endif
C) #ifdef
D) #ifndef
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
27
The C++ directive ____ allows you to test whether a class has already been defined in a project; it means "if not defined."
A) #define
B) #endif
C) #ifdef
D) #ifndef
A) #define
B) #endif
C) #ifdef
D) #ifndef
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
28
____ cohesion occurs when all of the function operations contribute to the performance of only one task.
A) Functional
B) Procedural
C) Complete
D) Default
A) Functional
B) Procedural
C) Complete
D) Default
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
29
Using an object within another object is known as ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
30
____ are simple routines that do nothing (or very little).
A) Prototypes
B) Initialization lists
C) Stubs
D) Auxiliary functions
A) Prototypes
B) Initialization lists
C) Stubs
D) Auxiliary functions
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
31
Implement a default constructor for the following class:
class Employee
{
private:
int idNum;
double hourlyRate;
public:
Employee();
void setIdNum(const int);
void setHourlyRate(const double);
int getIdNum();
double getHourlyRate();
};
class Employee
{
private:
int idNum;
double hourlyRate;
public:
Employee();
void setIdNum(const int);
void setHourlyRate(const double);
int getIdNum();
double getHourlyRate();
};
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
32
What are the four special member functions that every C++ class object automatically has?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
33
Why is it a good idea to implement your own default constructor, rather than letting C++ provide one?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
34
What does the default destructor of a class do?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
35
____ is a measure of the strength of the connection between two functions; it expresses the extent to which information is exchanged by functions.
A) Encapsulation
B) Abstraction
C) Cohesion
D) Coupling
A) Encapsulation
B) Abstraction
C) Cohesion
D) Coupling
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
36
The following code shows an example of ____:
Double square(double number)
{
Return (number * number);
}
A) coupling
B) tight coupling
C) loose coupling
D) functional cohesion
Double square(double number)
{
Return (number * number);
}
A) coupling
B) tight coupling
C) loose coupling
D) functional cohesion
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
37
Why must a constructor have the same name as its class?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
38
In highly ____________________ functions, all operations are related.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
39
A(n) ____________________ list provides constructor-required values for the member-objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
40
A(n) ____________________ constructor is one that requires at least one argument.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
41
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
42
In the software industry, what is RAD?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
43
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
44
Why should you avoid using digits in a variable, function or class name?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
45
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
46
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
47
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
48
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
49
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
50
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
51
Match between columns
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
52
What is the difference between tight coupling and loose coupling in functions?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck
53
Modify the following class definition so that it uses the #ifndef , #define and #endif directives:
class Salesperson
{
private:
int idNum;
string name;
public:
Salesperson(int, string);
void display();
};
Salesperson::Salesperson(int id, string lastName)
{
idNum = id;
name = lastName;
}
void Salesperson::display()
{
cout
class Salesperson
{
private:
int idNum;
string name;
public:
Salesperson(int, string);
void display();
};
Salesperson::Salesperson(int id, string lastName)
{
idNum = id;
name = lastName;
}
void Salesperson::display()
{
cout
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 53 في هذه المجموعة.
فتح الحزمة
k this deck