Name:
Class:
Date:
Page 1
Indicate whether the statement is true or false.
1. When two or more methods have the same name but different parameter lists, the methods are referred to as overloaded
methods.
a.
True
b.
False
2. Polymorphism refers to the fact that you can create one class from another class.
a.
True
b.
False
3. An object’s behaviors fall into two categories: actions that the object is capable of performing and actions to which the
object can respond.
a.
True
b.
False
4. A class contains all of the attributes and behaviors of the object it instantiates.
a.
True
b.
False
5. Every object in an object-oriented program is created from a class.
a.
True
b.
False
6. A program does not have direct access to a private variable within a class.
a.
True
b.
False
7. You can define your own classes in C++ and then create instances (objects) from those classes.
a.
True
b.
False
8. A base class is created from a derived class.
a.
True
b.
False
9. Before an object has been instantiated in a program, the program can refer to a public member of the class.
a.
True
b.
False
10. Every object has attributes, which are the characteristics that describe an object.
a.
True
b.
False
Indicate the answer choice that best completes the statement or answers the question.
Name:
Class:
Date:
Page 2
11. Which term is described as a class method whose instructions the computer automatically processes each time an
object is instantiated from the class?
a.
constructor
b.
instantiation
c.
encapsulation
d.
derived method
12. Using OOP terminology, which is the proper verb used to describe how objects are created from a class?
a.
derived
b.
morphed
c.
instantiated
d.
encapsulated
13. What is used to specify the attributes and behaviors of an object?
a.
abstraction
b.
class definition
c.
encapsulation
d.
instantiation
14. When creating a new class that inherits the attributes and behaviors of the original class, what is the new class called?
a.
derived class
b.
encapsulated class
c.
base class
d.
inherited class
15. Attributes and behaviors that are not hidden are said to be which of the following?
a.
encapsulated
b.
inherited
c.
exposed
d.
instantiated
16. Which of the following examples show the proper syntax for instantiating an object?
a.
objectName.publicMember;
b.
className objectName;
c.
objectName.className;
d.
className.publicMember;
17. How many default constructors can be in a class?
a.
0
b.
1
c.
2
d.
3
18. A function that is defined in a class definition is known as which of the following?
a.
constructor
b.
method
c.
initializer
d.
object
19. Which OOP term refers to the fact that you can create one class from another class?
a.
Inheritance
b.
Abstraction
c.
Polymorphism
d.
Instantiation
20. What are constructors that contain at least one parameter called?
a.
single constructor
b.
default constructor
c.
parameterized constructor
d.
optional constructor
21. What is a constructor that has no formal parameters called?
a.
actual constructor
b.
default constructor
c.
derived constructor
d.
hidden constructor
22. Which section of a class definition contains the method definitions?
Name:
Class:
Date:
Page 3
a.
declaration
b.
implementation
c.
instantiation
d.
none of the above
23. What is the file called that most programmers enter a class definition into?
a.
header file
b.
class file
c.
source code file
d.
object file
24. What does a programmer use to tell the compiler to include the contents of a header file in the program?
a.
a public declaration
b.
a #include directive
c.
a private declaration
d.
a using statement
25. In OOP terms, what does a class do to all of the attributes and behaviors of the object it instantiates?
a.
inherits
b.
encapsulates
c.
hides
d.
exposes
26. In C++, which symbol represents the scope resolution operator?
a.
&
b.
::
c.
<<
d.
>>
27. What are the characteristics that describe an object?
a.
instances
b.
classes
c.
attributes
d.
behaviors
28. The syntax for referring to a public member of an object’s class is shown in which of the following examples?
a.
objectName.publicMember
b.
className objectName;
c.
objectName.className;
d.
className.publicMember
29. What is the sole purpose of a constructor?
a.
initialize the class’s public variables
b.
initialize the class’s private variables
c.
define the class’s prototype methods
d.
define the class’s public methods
30. What does a program use to access a private variable within a class?
a.
private method
b.
public method
c.
public variable
d.
default constructor
31. Which term is the object-oriented feature that allows the same instruction to be carried out differently depending upon
the object?
a.
Inheritance
b.
Abstraction
c.
Polymorphism
d.
Instantiation
32. What is a pattern or blueprint that the computer uses to create an object?
a.
instance
b.
class
c.
attribute
d.
behavior
33. Which of the following terms best describes something that can be seen, touched, or used?
a.
object
b.
class
Name:
Class:
Date:
Page 4
c.
attribute
d.
behavior
34. Which section of a class definition begins with the keyword class followed by the name of the class?
a.
implementation section
b.
declaration section
c.
method section
d.
Pascal section
35. In OOP terminology, when a class is created from another class, what is the original class called?
a.
base
b.
original
c.
parent
d.
derived
36. What is the extension of header files?
a.
.cpp
b.
.h
c.
.header
d.
.obj
37. What is a constructor? What purpose does it serve?
38. What is abstraction? What is the advantage of abstraction?
39. Why is it advantageous to be able to reuse a class?
40. Give the syntax of the class statement in C++.
41. What are the differences between procedure-oriented programming and object-oriented programming?
42. What is an overloaded method and why might you want to overload a method?
43. Describe what it means to say that an object has behaviors.
44. What is inheritance? Include in your response the terms derived class, base class, attributes, and behaviors.
45. Is it better to enter the code for a class in a header file? Why or why not?
Name:
Class:
Date:
Page 5
Name:
Class:
Date:
Page 6
Name:
Class:
Date:
Page 7