Deck 2: Object-Oriented Design OOD and C++

ملء الشاشة (f)
exit full mode
سؤال
The base class inherits all its properties from the derived class.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
In single inheritance, the derived class is derived from a single base class.
سؤال
Private members of a base class can be accessed by a derived class.
سؤال
The derived class can redefine public member functions of a base class.
سؤال
Overriding a member function is the same as redefining it.
سؤال
Redefining a member function is the same as overloading the member function.
سؤال
A class cannot have a constructor with default parameters.
سؤال
A derived class cannot have a constructor with default parameters.
سؤال
Header files of new classes contain commands that tell the computer where to look for definitions of the base class.
سؤال
In C++ the user can create new operators.
سؤال
Default arguments can be used with an overloaded operator.
سؤال
When overloading an operator, the meaning of how an operator works with built-in types remains the same.
سؤال
A friend function is a member function of a class but only has access to the class's public data members.
سؤال
The function that overloads any of the operators (), [], ->, or = for a class must be declared as a member of the class.
سؤال
For efficiency purposes, wherever possible, you should overload operators as nonmember functions.
سؤال
By using templates, you can write a single code segment for a set of related functions.
سؤال
Just as variables are parameters to functions, data types are parameters to templates.
سؤال
In single inheritance, the derived class is derived from ____base class(es).

A) one
B) two
C) three or more
D) virtual
سؤال
If there are three classes, shape, circle, and square, what is the most likely relationship among them?

A) The square class is a base class, and shape and circle are derived classes of square.
B) The shape class is a base class, and circle and square are derived classes of shape.
C) The shape, circle, and square classes are all sibling classes.
D) These three classes cannot be related.
سؤال
If class dog has a derived class retriever, which of the following is true?

A) In the case of single inheritance, dog can have no other derived classes.
B) In the case of single inheritance, retriever is derived from no other class except dog.
C) The relationship between these classes implies that dog "is a" retriever.
D) The relationship between these classes implies that retriever "has-a" dog.
سؤال
We need to ensure that the private member variables that are inherited from the base class are initialized when a ____ of the derived class executes.

A) destructor
B) constructor
C) copy constructor
D) friend function
سؤال
When you declare a derived class object, this object inherits the members of the base class, but the derived class object cannot directly access the ____.

A) private data members of the base class
B) data members in its own class
C) base class constructors
D) public data members of the base class
سؤال
A(n) ____ typically serves to initialize the member variables of a derived class.

A) inheritor
B) initiator
C) deconstructor
D) constructor
سؤال
A call to the base class constructor is specified in the ____ of a derived class constructor.

A) body of the definition
B) body of the constructor
C) heading of the definition
D) heading of the constructor
سؤال
If a class contains the default constructor and no values are specified when the object is declared, the ____ executes and initializes the object.

A) default destructor
B) first destructor in the program listing
C) last constructor in the program listing
D) default constructor
سؤال
To define new classes, you create new ____ files.

A) header
B) friend
C) prototype
D) placeholder
سؤال
The definitions of member functions can be placed in a separate file whose extension is ____.

A) .cxx
B) .c
C) .cpp
D) .cc
سؤال
To include a system-provided header file, such as iostream, in a user program, you enclose the header file between ____.

A) curly brackets
B) angular brackets
C) asterisks
D) square brackets
سؤال
To include a header file in a program, you use the preprocessor command ____.

A) pragma
B) fetch
C) pull
D) include
سؤال
For a base class to give access to a member to its derived class and still prevent its direct access outside the class, you must declare that member under the member access specifier ____.

A) private
B) protected
C) public
D) shared
سؤال
In ____, one or more members of a class are objects of another class type.

A) inheritance
B) redefinition
C) composition
D) encapsulation
سؤال
Composition is a(n) "____" relationship.

A) is a
B) has a
C) was a
D) had a
سؤال
The arguments to the constructor of a member object are specified in the ____ part of the definition of the constructor of the class.

A) body
B) pragma
C) scope
D) heading
سؤال
By using templates, you can write a single code segment for a set of related functions, called a ____.

A) function template
B) function type
C) class set
D) class template
سؤال
Passing parameters to a function has an effect at ____ time.

A) compile
B) link
C) run
D) build
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 2: Object-Oriented Design OOD and C++
1
The base class inherits all its properties from the derived class.
False
2
In single inheritance, the derived class is derived from a single base class.
True
3
Private members of a base class can be accessed by a derived class.
False
4
The derived class can redefine public member functions of a base class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
Overriding a member function is the same as redefining it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
6
Redefining a member function is the same as overloading the member function.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
7
A class cannot have a constructor with default parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
A derived class cannot have a constructor with default parameters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
9
Header files of new classes contain commands that tell the computer where to look for definitions of the base class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
10
In C++ the user can create new operators.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
11
Default arguments can be used with an overloaded operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
12
When overloading an operator, the meaning of how an operator works with built-in types remains the same.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
13
A friend function is a member function of a class but only has access to the class's public data members.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
14
The function that overloads any of the operators (), [], ->, or = for a class must be declared as a member of the class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
15
For efficiency purposes, wherever possible, you should overload operators as nonmember functions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
16
By using templates, you can write a single code segment for a set of related functions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
17
Just as variables are parameters to functions, data types are parameters to templates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
18
In single inheritance, the derived class is derived from ____base class(es).

A) one
B) two
C) three or more
D) virtual
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
19
If there are three classes, shape, circle, and square, what is the most likely relationship among them?

A) The square class is a base class, and shape and circle are derived classes of square.
B) The shape class is a base class, and circle and square are derived classes of shape.
C) The shape, circle, and square classes are all sibling classes.
D) These three classes cannot be related.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
20
If class dog has a derived class retriever, which of the following is true?

A) In the case of single inheritance, dog can have no other derived classes.
B) In the case of single inheritance, retriever is derived from no other class except dog.
C) The relationship between these classes implies that dog "is a" retriever.
D) The relationship between these classes implies that retriever "has-a" dog.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
21
We need to ensure that the private member variables that are inherited from the base class are initialized when a ____ of the derived class executes.

A) destructor
B) constructor
C) copy constructor
D) friend function
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
22
When you declare a derived class object, this object inherits the members of the base class, but the derived class object cannot directly access the ____.

A) private data members of the base class
B) data members in its own class
C) base class constructors
D) public data members of the base class
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
23
A(n) ____ typically serves to initialize the member variables of a derived class.

A) inheritor
B) initiator
C) deconstructor
D) constructor
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
24
A call to the base class constructor is specified in the ____ of a derived class constructor.

A) body of the definition
B) body of the constructor
C) heading of the definition
D) heading of the constructor
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
25
If a class contains the default constructor and no values are specified when the object is declared, the ____ executes and initializes the object.

A) default destructor
B) first destructor in the program listing
C) last constructor in the program listing
D) default constructor
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
26
To define new classes, you create new ____ files.

A) header
B) friend
C) prototype
D) placeholder
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
27
The definitions of member functions can be placed in a separate file whose extension is ____.

A) .cxx
B) .c
C) .cpp
D) .cc
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
28
To include a system-provided header file, such as iostream, in a user program, you enclose the header file between ____.

A) curly brackets
B) angular brackets
C) asterisks
D) square brackets
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
29
To include a header file in a program, you use the preprocessor command ____.

A) pragma
B) fetch
C) pull
D) include
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
30
For a base class to give access to a member to its derived class and still prevent its direct access outside the class, you must declare that member under the member access specifier ____.

A) private
B) protected
C) public
D) shared
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
31
In ____, one or more members of a class are objects of another class type.

A) inheritance
B) redefinition
C) composition
D) encapsulation
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
32
Composition is a(n) "____" relationship.

A) is a
B) has a
C) was a
D) had a
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
33
The arguments to the constructor of a member object are specified in the ____ part of the definition of the constructor of the class.

A) body
B) pragma
C) scope
D) heading
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
34
By using templates, you can write a single code segment for a set of related functions, called a ____.

A) function template
B) function type
C) class set
D) class template
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
35
Passing parameters to a function has an effect at ____ time.

A) compile
B) link
C) run
D) build
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.