Exam 11: Friends, overloaded Operators, and Arrays in Classes

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Why should you generally pass an object of the class to a friend function as a reference parameter?

Free
(Multiple Choice)
4.7/5
(35)
Correct Answer:
Verified

E

Which of the following statements are true?

Free
(Multiple Choice)
4.7/5
(38)
Correct Answer:
Verified

C

Since accessor functions in a class do not modify or mutate the data members of the object,the function should have the __________ modifier.

Free
(Multiple Choice)
4.7/5
(35)
Correct Answer:
Verified

C

All operators can be overloaded.

(True/False)
4.7/5
(37)

Who can access private data in a class?

(Multiple Choice)
4.7/5
(42)

A _________ function is not a member of the class,but has access to the private members of the class.

(Short Answer)
4.8/5
(31)

If we have a full selection of accessor and mutator functions,why would we have friend functions?

(Multiple Choice)
4.8/5
(35)

You may not change the precedence of operators by overloading them

(True/False)
4.7/5
(41)

An operator that expects only one parameter is called a ________ operator

(Short Answer)
4.7/5
(40)

A friend function needs to be passed an object of the class.If the friend only needs to access the object,but not change its data members,then the object should be passed as _______________

(Short Answer)
4.8/5
(41)

Which of the following operators can not be overloaded?

(Multiple Choice)
4.8/5
(34)

The assignment operator must be a _________ of the class.

(Short Answer)
4.8/5
(32)

The following is a properly declared overloaded insertion operator for myClass. ostream& operator <<ostream &out,const myClass &obj);

(True/False)
4.9/5
(41)

Functions that are constant member functions may call the class mutator functions.

(True/False)
4.9/5
(34)

When overloading an operator,which of the following is true?

(Multiple Choice)
4.7/5
(29)

The destructor for a class is called

(Multiple Choice)
4.9/5
(36)

Functions that are constant member functions may call constant class accessor functions.

(True/False)
4.8/5
(35)

You cannot create new operators such as the quote).

(True/False)
4.7/5
(23)

Which of the following function declarations would be correct to overload the multiply operator for the Rational numbers class?

(Multiple Choice)
4.8/5
(32)

Putting the keyword const in front of a pass by reference parameter guarantees ___________________

(Essay)
4.9/5
(29)
Showing 1 - 20 of 49
close modal

Filters

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