Which of the following is true? You overload an operator by making the operator
ID: 3544559 • Letter: W
Question
Which of the following is true?
You overload an operator by making the operator an argument to a method.
You should overload every C++ operator for each new class you create..
Operators that are normally defined to be only unary must remain unary when you overload them.
Which of the following operators can be overloaded to be binary?
>
&
++
!
Which of the following operators can be overloaded ?
.
&
::
?:
If you have correctly overloaded the * operator to multiply two members of the Furniture class, and you have declared two Furniture objects, aDesk, and aChair, then which of the following is a legal expression?
Furniture * Furniture;
aDesk * aChair;
Furniture * aChair;
All of the above
If you have correctly overloaded the * operator to multiply two members of the Furniture class, and you have declared two Furniture objects, aDesk, and a aChair, then which of the following is a legal expression?
aChair.operator*(aDesk);
aChair * aChair;
aChair * aDesk;
all of the above
The Shipment class holds information about a shipment, including its weight. An overloaded division operator divides a Shipment
Explanation / Answer
1.Operators that are normally defined to be only unary must remain unary when you overload them.
2.&
3.&
4.aDesk * aChair;
5.aChair.operator*(aDesk);
6.int numPackages = packages.totalWeight / packages;
7.int difference = totalWeight
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.