COP 3330 EXAM 2 HIGH-YIELD
CONSTRUCTORS, POINTERS, MEMORY
MANAGEMENT, AND OOP DESIGN SUMMARY
2026
◉ Which of the following is not a valid operator overload prototype?
(Phrase is a class)
Answer: bool operator!< (const Phrase& a, const Phrase& b);
◉ Which of the following is a function that will only allow an L-value
to be passed as a parameter? (Assume that Icon is a class)
Answer: int Compute(Icon & i) const;
◉ Which of the following is the most appropriate declaration of an
accessor function for a class called Grade?
Answer: double GetValue() const;
◉ Which of the following is a correct way to declare a member
function of a class so that it will be guaranteed to not change the
member data of the calling object?
Answer: int Convert(float& x) const;
, ◉ If a binary operator is overloaded and written as a member
function of a class, the function takes one parameter
Answer: True
◉ A friend of a class has access only to the public section of that
class.
Answer: False
◉ The command "g++ -o employee.cpp" invokes the compile stage
but not the linking stage of the compilation process.
Answer: False
◉ An L-value is an expression that represents a modifiable storage
location.
Answer: True
◉ A class may have more than one destructor.
Answer: False
◉ Function calls are matched to their definitions during the
compiling stage of a program build (not during the linking stage).
Answer: False
CONSTRUCTORS, POINTERS, MEMORY
MANAGEMENT, AND OOP DESIGN SUMMARY
2026
◉ Which of the following is not a valid operator overload prototype?
(Phrase is a class)
Answer: bool operator!< (const Phrase& a, const Phrase& b);
◉ Which of the following is a function that will only allow an L-value
to be passed as a parameter? (Assume that Icon is a class)
Answer: int Compute(Icon & i) const;
◉ Which of the following is the most appropriate declaration of an
accessor function for a class called Grade?
Answer: double GetValue() const;
◉ Which of the following is a correct way to declare a member
function of a class so that it will be guaranteed to not change the
member data of the calling object?
Answer: int Convert(float& x) const;
, ◉ If a binary operator is overloaded and written as a member
function of a class, the function takes one parameter
Answer: True
◉ A friend of a class has access only to the public section of that
class.
Answer: False
◉ The command "g++ -o employee.cpp" invokes the compile stage
but not the linking stage of the compilation process.
Answer: False
◉ An L-value is an expression that represents a modifiable storage
location.
Answer: True
◉ A class may have more than one destructor.
Answer: False
◉ Function calls are matched to their definitions during the
compiling stage of a program build (not during the linking stage).
Answer: False