COP 3330 EXAM 1 CORE PROGRAMMING
FUNDAMENTALS AND C++ BASICS REVIEW
2026
◉ There may be more than one correct answer. When you define a
C++ class so that the result is an ADT, which of the following remarks
about whether to make a member variable or function public or
private are correct?
a. Don't make member variables public.
b. Make them all public. It simplifies life and makes things more
efficient to be able access members anywhere.
c. Make all member functions public.
d. There are some member functions that shouldn't be public, but
most should be public..
Answer: a. Don't make member variables public
d. There are some member functions that shouldn't be public, but
most should be public.
◉ The following definition of the structure variables of type
myStruct s and t could be made using several definitions using the
structure tag.
struct myStruct
{
,int i;
double d;
} s, t;
True or False.
Answer: True
◉ There may be more than 1 correct answer.
Concerning nested classes, which of the following are true?
a. The inner class must always be public
b. The inner class is within the scope of the outer class.
c. Qualification by the outer class name with the scope resolution
operator is necessary to use the inner class outside the outer class.
d. A local class can contain static members.
e. You can define a class within a class..
Answer: b. The inner class is within the scope of the outer class.
c. Qualification by the outer class name with the scope resolution
operator is necessary to use the inner class outside the outer class.
e. You can define a class within a class.
◉ There may be more than 1 correct answer.
A constructor ....
a. can only be used to initialize
, b. can do anything other method can do
c. must initialize all member variables
d. usually initializes all or most member variables.
Answer: b. can do anything any other method can do
d. usually initializes all, or most, member variables.
◉ A constructor can be called implicitly or explicitly. (Implicitly
means the compiler did it for you.) In the interest of uniformity in
answers, please use classA; for your examples.
True or False.
Answer: True
◉ size and capacity of a vector are two names for the same thing.
True or False.
Answer: False
◉ If we use an out of range index with a vector, there be an error
message from the compiler.
True or False.
Answer: False
◉ There may be more than 1 correct answer.
FUNDAMENTALS AND C++ BASICS REVIEW
2026
◉ There may be more than one correct answer. When you define a
C++ class so that the result is an ADT, which of the following remarks
about whether to make a member variable or function public or
private are correct?
a. Don't make member variables public.
b. Make them all public. It simplifies life and makes things more
efficient to be able access members anywhere.
c. Make all member functions public.
d. There are some member functions that shouldn't be public, but
most should be public..
Answer: a. Don't make member variables public
d. There are some member functions that shouldn't be public, but
most should be public.
◉ The following definition of the structure variables of type
myStruct s and t could be made using several definitions using the
structure tag.
struct myStruct
{
,int i;
double d;
} s, t;
True or False.
Answer: True
◉ There may be more than 1 correct answer.
Concerning nested classes, which of the following are true?
a. The inner class must always be public
b. The inner class is within the scope of the outer class.
c. Qualification by the outer class name with the scope resolution
operator is necessary to use the inner class outside the outer class.
d. A local class can contain static members.
e. You can define a class within a class..
Answer: b. The inner class is within the scope of the outer class.
c. Qualification by the outer class name with the scope resolution
operator is necessary to use the inner class outside the outer class.
e. You can define a class within a class.
◉ There may be more than 1 correct answer.
A constructor ....
a. can only be used to initialize
, b. can do anything other method can do
c. must initialize all member variables
d. usually initializes all or most member variables.
Answer: b. can do anything any other method can do
d. usually initializes all, or most, member variables.
◉ A constructor can be called implicitly or explicitly. (Implicitly
means the compiler did it for you.) In the interest of uniformity in
answers, please use classA; for your examples.
True or False.
Answer: True
◉ size and capacity of a vector are two names for the same thing.
True or False.
Answer: False
◉ If we use an out of range index with a vector, there be an error
message from the compiler.
True or False.
Answer: False
◉ There may be more than 1 correct answer.