Exam 9: Understanding Friends and Overloading Operators

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

The ____________________ function overloads the decrement operator.

(Short Answer)
5.0/5
(31)

In C++, you use the ____ operator to dynamically allocate memory.

(Multiple Choice)
4.8/5
(42)
Match each term with the correct statement below.
Premises:
multiple calls to the same operator function
Responses:
stacking
operator overloading
pure polymorphism
Correct Answer:
Verified
Premises:
Responses:
multiple calls to the same operator function
stacking
(Matching)
4.8/5
(33)

When do you use encapsulation and data hiding?

(Essay)
4.9/5
(37)

A(n) ____________________ class is a class in which all functions can access the non-public members of another class.

(Short Answer)
4.8/5
(38)

You are required to use the word friend within the function name of a friend function.

(True/False)
4.9/5
(40)

Which are the five operators that cannot be overloaded in C++?

(Essay)
4.8/5
(47)
Match each term with the correct statement below.
Premises:
memory that is no longer assigned to anything in an application
Responses:
parametric overloading
pure polymorphism
stacking
Correct Answer:
Verified
Premises:
Responses:
memory that is no longer assigned to anything in an application
parametric overloading
(Matching)
4.9/5
(46)

To ____ operations is to allow several operators to be used within the same expression.

(Multiple Choice)
4.8/5
(35)

In addition to overloading, compilers often need to perform coercion or casting when the + symbol is used with mixed arithmetic.

(True/False)
4.7/5
(36)

C++ ____ you to use the built-in precedence rules for your class operators.

(Multiple Choice)
4.9/5
(40)

When would you want to use friend functions?

(Essay)
4.8/5
(33)

Consider the following class declaration: #include using namespace std; class Employee { private: int idNum; double salary; public: Employee(int, double); double operator+(Employee); }; Write an implementation for the operator+() function.

(Essay)
5.0/5
(30)

When you allocate memory during the execution of a program (as opposed to when the program is compiled) you ____________________ allocate memory.

(Short Answer)
4.9/5
(35)

The C++ friend relationship is always one-sided.

(True/False)
4.9/5
(35)

The = operator() function overloads the assignment operator.

(True/False)
4.8/5
(35)

The ____ operator is a unary operator.

(Multiple Choice)
4.8/5
(31)

To ____ memory for a field is to allot storage for and assign a name to it.

(Multiple Choice)
4.8/5
(28)

To use arithmetic symbols with your own objects, you must ____________________ the symbols.

(Short Answer)
4.9/5
(35)

____ is an example of overloading the prefix increment operator.

(Multiple Choice)
5.0/5
(34)
Showing 21 - 40 of 52
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)