Question
1) Encapsulation combines an ADTs data with its operations to form a(n) ______. exception method object variable 2)A(n) ______ is a C++ construct that enables
1) Encapsulation combines an ADTs data with its operations to form a(n) ______.
exception
method
object
variable
2)A(n) ______ is a C++ construct that enables a programmer to define a new data type.
class
method
data field
object
3) A C++ class contains data members and ______.
clients
interfaces
methods
data structures
4) A(n) ______ is an instance of a class.
method
data field
interface
object
5) Which of the following is true about a constructor in C++?
all constructors have a return type of void
a constructor cannot have parameters
a constructor has the same name as the class
a class can only have a single constructor
6) A(n) ______ is a class that inherits the members of another class.
base class
superclass
abstract class
subclass
7) Which of the following is true about a destructor in C++?
a class can have several destructors
the compiler will generate a destructor if the programmer does not provide one
a programmer must provide a destructor for every class
a destructor destroys all instances of a class
8) In C++, each class definition should be placed in a(n) ______.
implementation file
header file
namespace
package
9) C++ provides a mechanism for logically grouping class definitions and other declarations into a common declarative region known as a(n) ______.
namespace
interface
header
package
10) When defining class A so that any of its instances can invoke any of the publicly defined methods of class B, the keyword ______ precedes the name of class B.
public
global
static
final
11) A function can indicate that an error has occurred by ______ an exception.
throwing
catching
implementing
declaring
12) To ______ an exception means to deal with the error condition.
declare
catch
implement
try
13) Which of the following is true about runtime exceptions?
they must be handled locally
they must be explicitly thrown from the method
they are used in situations where the method has encountered a serious problem
they can often be prevented by fail-safe programming
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started